@@ -103,7 +103,7 @@ jobs:
103
103
rustup toolchain install nightly --profile minimal --component rustfmt
104
104
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
105
105
- name : Install Rust Problem Matcher
106
- if : matrix.os == 'ubuntu -latest'
106
+ if : matrix.os == 'macos -latest'
107
107
run : echo "::add-matcher::.github/rust.json"
108
108
109
109
# - name: Cache Dependencies
@@ -120,23 +120,9 @@ jobs:
120
120
if : matrix.os == 'ubuntu-latest'
121
121
run : cargo codegen --check
122
122
123
- - name : Compile tests
124
- run : cargo test --no-run
125
-
126
123
- name : Run tests
127
124
run : cargo nextest run --no-fail-fast --hide-progress-bar --status-level fail
128
125
129
- - name : Cancel parallel jobs
130
- if : failure()
131
- run : |
132
- # https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#cancel-a-workflow-run
133
- curl -L \
134
- -X POST \
135
- -H "Accept: application/vnd.github.v3+json" \
136
- -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
137
- -H "X-GitHub-Api-Version: 2022-11-28" \
138
- https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel
139
-
140
126
- name : Run Clippy
141
127
if : matrix.os == 'macos-latest'
142
128
run : cargo clippy --all-targets -- -D clippy::disallowed_macros -D clippy::dbg_macro -D clippy::todo -D clippy::print_stdout -D clippy::print_stderr
@@ -337,3 +323,21 @@ jobs:
337
323
jq -C <<< '${{ toJson(needs) }}'
338
324
# Check if all jobs that we depend on (in the needs array) were successful (or have been skipped).
339
325
jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}'
326
+
327
+ cancel-if-matrix-failed :
328
+ needs : rust
329
+ runs-on : ubuntu-latest
330
+ steps :
331
+ - name : Cancel parallel jobs
332
+ if : failure()
333
+ run : |
334
+ if [ jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< '${{ toJson(needs) }}' ]; then
335
+ exit 0
336
+ fi
337
+ # https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#cancel-a-workflow-run
338
+ curl -L \
339
+ -X POST \
340
+ -H "Accept: application/vnd.github.v3+json" \
341
+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
342
+ -H "X-GitHub-Api-Version: 2022-11-28" \
343
+ https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel
0 commit comments