diff --git a/.github/workflows/cancel-merged-pr-tests.yml b/.github/workflows/cancel-merged-pr-tests.yml new file mode 100644 index 0000000000..e5fd8cf5f8 --- /dev/null +++ b/.github/workflows/cancel-merged-pr-tests.yml @@ -0,0 +1,30 @@ +name: Cancel Merged PR Tests + +on: + pull_request: + branches: [main] + types: [closed] + +permissions: + contents: read + +jobs: + gateway-tests: + name: Cancel PR Test (SMG) + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + concurrency: + group: gateway-tests-pr-${{ github.event.pull_request.number }} + cancel-in-progress: true + steps: + - run: echo "Cancelling in-progress PR Test (SMG) runs for merged PR #${{ github.event.pull_request.number }}." + + mlx-tests: + name: Cancel PR Test (MLX) + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + concurrency: + group: mlx-tests-pr-${{ github.event.pull_request.number }} + cancel-in-progress: true + steps: + - run: echo "Cancelling in-progress PR Test (MLX) runs for merged PR #${{ github.event.pull_request.number }}." diff --git a/.github/workflows/pr-test-mlx.yml b/.github/workflows/pr-test-mlx.yml index a5fee94458..d4146d4d14 100644 --- a/.github/workflows/pr-test-mlx.yml +++ b/.github/workflows/pr-test-mlx.yml @@ -36,8 +36,8 @@ permissions: contents: read concurrency: - group: mlx-tests-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: mlx-tests-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref_name }} + cancel-in-progress: true jobs: e2e-mlx: diff --git a/.github/workflows/pr-test-rust.yml b/.github/workflows/pr-test-rust.yml index f37861637e..f0a3a2d86a 100644 --- a/.github/workflows/pr-test-rust.yml +++ b/.github/workflows/pr-test-rust.yml @@ -20,8 +20,8 @@ permissions: contents: read concurrency: - group: gateway-tests-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} + group: gateway-tests-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.ref_name }} + cancel-in-progress: true env: RUSTC_WRAPPER: sccache