From 5e85cd471b279727f79dd392b3345e94a1ab9f24 Mon Sep 17 00:00:00 2001 From: Quentin Mc Gaw Date: Wed, 5 Feb 2025 13:41:27 +0100 Subject: [PATCH 1/2] chore(ci): restrict each job concurrency to 1 except for main branch --- .github/workflows/go.yml | 6 ++++++ .github/workflows/golangci-lint.yml | 3 +++ .github/workflows/labels.yml | 3 +++ .github/workflows/libevm-delta.yml | 3 +++ .github/workflows/rename-module.yml | 3 +++ .github/workflows/yml.yml | 3 +++ 6 files changed, 21 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 17f887d20e1..c65db311940 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -12,6 +12,9 @@ jobs: env: FLAKY_REGEX: "ava-labs/libevm/(triedb/pathdb|eth|eth/tracers/js|eth/tracers/logger|accounts/abi/bind|accounts/keystore|eth/downloader|miner|ethclient|ethclient/gethclient|eth/catalyst)$" runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - name: Set up Go @@ -30,6 +33,9 @@ jobs: env: EXCLUDE_REGEX: "ava-labs/libevm/(accounts/usbwallet/trezor)$" runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - name: Set up Go diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index fc1968ed487..7e10f6880a0 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -17,6 +17,9 @@ jobs: golangci: name: lint runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 515691cafe1..cf695cf6f68 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -16,6 +16,9 @@ jobs: permissions: contents: read issues: write + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/libevm-delta.yml b/.github/workflows/libevm-delta.yml index cd146748178..89952e9297d 100644 --- a/.github/workflows/libevm-delta.yml +++ b/.github/workflows/libevm-delta.yml @@ -10,6 +10,9 @@ on: jobs: diffs: runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/rename-module.yml b/.github/workflows/rename-module.yml index 2d74418cd61..ef51613c005 100644 --- a/.github/workflows/rename-module.yml +++ b/.github/workflows/rename-module.yml @@ -12,6 +12,9 @@ on: jobs: rename-module: runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/yml.yml b/.github/workflows/yml.yml index de3da43dd52..5f9bf479cd6 100644 --- a/.github/workflows/yml.yml +++ b/.github/workflows/yml.yml @@ -12,6 +12,9 @@ on: jobs: yaml-check: runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - name: Validate YAML files From c687962c2be0b50e90355cb2bc6260e7fce59985 Mon Sep 17 00:00:00 2001 From: Quentin Mc Gaw Date: Wed, 5 Feb 2025 14:09:45 +0100 Subject: [PATCH 2/2] Move concurrency block to the workflow level --- .github/workflows/go.yml | 10 ++++------ .github/workflows/golangci-lint.yml | 7 ++++--- .github/workflows/labels.yml | 7 ++++--- .github/workflows/libevm-delta.yml | 7 ++++--- .github/workflows/rename-module.yml | 7 ++++--- .github/workflows/yml.yml | 7 ++++--- 6 files changed, 24 insertions(+), 21 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c65db311940..39947790904 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -7,14 +7,15 @@ on: branches: [main, "release/**"] workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: go_test_short: env: FLAKY_REGEX: "ava-labs/libevm/(triedb/pathdb|eth|eth/tracers/js|eth/tracers/logger|accounts/abi/bind|accounts/keystore|eth/downloader|miner|ethclient|ethclient/gethclient|eth/catalyst)$" runs-on: ubuntu-latest - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - name: Set up Go @@ -33,9 +34,6 @@ jobs: env: EXCLUDE_REGEX: "ava-labs/libevm/(accounts/usbwallet/trezor)$" runs-on: ubuntu-latest - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - name: Set up Go diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 7e10f6880a0..69aa640518f 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -13,13 +13,14 @@ permissions: # Optional: allow read access to pull request. Use with `only-new-issues` option. pull-requests: read +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: golangci: name: lint runs-on: ubuntu-latest - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index cf695cf6f68..706254182ff 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -11,14 +11,15 @@ on: - .github/labels.yml - .github/workflows/labels.yml +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: labeler: permissions: contents: read issues: write - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/libevm-delta.yml b/.github/workflows/libevm-delta.yml index 89952e9297d..950ea742735 100644 --- a/.github/workflows/libevm-delta.yml +++ b/.github/workflows/libevm-delta.yml @@ -7,12 +7,13 @@ on: branches: [main, "release/**"] workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: diffs: runs-on: ubuntu-latest - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/rename-module.yml b/.github/workflows/rename-module.yml index ef51613c005..d6e683d436d 100644 --- a/.github/workflows/rename-module.yml +++ b/.github/workflows/rename-module.yml @@ -9,12 +9,13 @@ on: type: string default: "2bd6bd01d2e8561dd7fc21b631f4a34ac16627a1" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: rename-module: runs-on: ubuntu-latest - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/yml.yml b/.github/workflows/yml.yml index 5f9bf479cd6..ece1d125734 100644 --- a/.github/workflows/yml.yml +++ b/.github/workflows/yml.yml @@ -9,12 +9,13 @@ on: - ".github/workflows/yml.yml" - ".github/yamllint.yml" +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: yaml-check: runs-on: ubuntu-latest - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} steps: - uses: actions/checkout@v4 - name: Validate YAML files