Skip to content

Commit 8d21c59

Browse files
committed
Check formatting on CI
1 parent 32cf157 commit 8d21c59

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

azure-pipelines.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,3 +198,48 @@ jobs:
198198
if [ $? -eq 109 ]; then (exit 0); else (exit 1); fi
199199
workingDirectory: example-kernels/runner
200200
displayName: 'Run `cargo xrun` for "runner" kernel'
201+
202+
- job: formatting
203+
displayName: Check Formatting
204+
205+
strategy:
206+
matrix:
207+
linux:
208+
image_name: 'ubuntu-16.04'
209+
rustup_toolchain: stable
210+
211+
pool:
212+
vmImage: $(image_name)
213+
214+
steps:
215+
- bash: |
216+
echo "Hello world from $AGENT_NAME running on $AGENT_OS"
217+
echo "Reason: $BUILD_REASON"
218+
case "$BUILD_REASON" in
219+
"Manual") echo "$BUILD_REQUESTEDFOR manually queued the build." ;;
220+
"PullRequest") echo "This is a CI build for a pull request on $BUILD_REQUESTEDFOR." ;;
221+
"IndividualCI") echo "This is a CI build for $BUILD_REQUESTEDFOR." ;;
222+
"BatchedCI") echo "This is a batched CI build for $BUILD_REQUESTEDFOR." ;;
223+
*) "$BUILD_REASON" ;;
224+
esac
225+
displayName: 'Build Info'
226+
continueOnError: true
227+
228+
- script: |
229+
set -euxo pipefail
230+
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
231+
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
232+
condition: or(eq( variables['Agent.OS'], 'Linux' ), eq( variables['Agent.OS'], 'Darwin' ))
233+
displayName: 'Install Rust'
234+
235+
- script: |
236+
rustc -Vv
237+
cargo -V
238+
displayName: 'Print Rust Version'
239+
continueOnError: true
240+
241+
- script: rustup component add rustfmt
242+
displayName: 'Install Rustfmt'
243+
244+
- script: cargo fmt -- --check
245+
displayName: 'Check Formatting'

0 commit comments

Comments
 (0)