Skip to content

Commit

Permalink
Friendlier GH Actions Queue (#1280)
Browse files Browse the repository at this point in the history
We now cancel previous queued and in progress actions runs on PRs when a
PR is updated. Because [`github.head_ref` is only defined for PRs and
`github.run_id` is
unique-per-workflow](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value-1),
we won't cancel previous jobs on branches, meaning that we'll still see
a log of which commits succeeded and which ones failed.
  • Loading branch information
JasonGross authored Jun 3, 2022
1 parent fa6f703 commit 9103dec
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:

runs-on: ubuntu-latest

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/coq-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:

runs-on: macOS-10.15

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
NJOBS: "2"
COQ_VERSION: "8.14.0"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/coq-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ jobs:

runs-on: windows-latest

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
NJOBS: "2"
COQ_VERSION: "8.12.0" # https://packages.debian.org/stable/coq
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/coq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ jobs:
env: ${{ matrix.env }}
name: ${{ matrix.env.COQ_VERSION }}

concurrency:
group: ${{ github.workflow }}-${{ matrix.env.COQ_VERSION }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:

runs-on: ubuntu-latest

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:

runs-on: ubuntu-latest

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v3
with:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,14 @@ on:
- cron: '0 0 1 * *'

jobs:
test-go:
test-json:

runs-on: ubuntu-latest

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ jobs:

runs-on: ubuntu-latest

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

steps:
- uses: actions/checkout@v3
- name: cargo build
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/zig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ jobs:
test-zig:
runs-on: ubuntu-latest

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

steps:
- name: Install Zig
uses: goto-bus-stop/setup-zig@v1
Expand Down

0 comments on commit 9103dec

Please sign in to comment.