Skip to content

ci: cancel parallel jobs if test fails #19521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,31 @@ jobs:
# . -> target
# ./crates/proc-macro-srv/proc-macro-test/imp -> target

- uses: taiki-e/install-action@nextest
- name: Install nextest
uses: taiki-e/install-action@nextest

- name: Codegen checks (rust-analyzer)
if: matrix.os == 'ubuntu-latest'
run: cargo codegen --check

- name: Compile (tests)
- name: Compile tests
run: cargo test --no-run

- name: Test
- name: Run tests
run: cargo nextest run --no-fail-fast --hide-progress-bar --status-level fail

- name: clippy
- name: Cancel parallel jobs
if: failure()
run: |
# https://docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28#cancel-a-workflow-run
curl -L \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel

- name: Run Clippy
if: matrix.os == 'macos-latest'
run: cargo clippy --all-targets -- -D clippy::disallowed_macros -D clippy::dbg_macro -D clippy::todo -D clippy::print_stdout -D clippy::print_stderr

Expand Down