about summary refs log tree commit diff
path: root/src/tools
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2025-04-14 11:08:43 +0000
committerGitHub <noreply@github.com>2025-04-14 11:08:43 +0000
commit0e091ac63a8afbdecb875ecc980d708cf9643820 (patch)
treead50dd20cbce0ae59a16f511533c1f62c978b955 /src/tools
parentef701b351618c04a146d80e621d04bdf5f850927 (diff)
parent03c71b6f0042d054d7d9db37357eefe893253d37 (diff)
downloadrust-0e091ac63a8afbdecb875ecc980d708cf9643820.tar.gz
rust-0e091ac63a8afbdecb875ecc980d708cf9643820.zip
Merge pull request #19521 from snprajwal/ci
ci: cancel parallel jobs if test fails
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/rust-analyzer/.github/workflows/ci.yaml20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/tools/rust-analyzer/.github/workflows/ci.yaml b/src/tools/rust-analyzer/.github/workflows/ci.yaml
index fa08fc26e35..84524201c37 100644
--- a/src/tools/rust-analyzer/.github/workflows/ci.yaml
+++ b/src/tools/rust-analyzer/.github/workflows/ci.yaml
@@ -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