Skip to content

Commit

Permalink
Use concurrency to cancel existing workflow jobs
Browse files Browse the repository at this point in the history
Setting concurrency groups for called workflows will cancel too much
Remove concurrency from benchmark due to main only
  • Loading branch information
andreas-el committed Mar 7, 2024
1 parent 06da87b commit 21d8ae3
Show file tree
Hide file tree
Showing 15 changed files with 47 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
name: Lint GitHub Actions workflows
on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
actionlint:
runs-on: ubuntu-latest
name: Check all workflow files
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Download actionlint
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/annotate_cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ name: Annotate Cpp

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
annotate-cpp:
strategy:
matrix:
os: ['ubuntu-latest']

runs-on: ${{ matrix.os }}
timeout-minutes: 60

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
benchmark:
name: Run pytest-benchmark benchmark example
runs-on: ubuntu-latest

timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ on:
inputs:
python-version:
type: string
jobs:

jobs:
build-wheels:
timeout-minutes: 30
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-wheels-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
type: string
os:
type: string
jobs:

jobs:
build-wheels:
timeout-minutes: 45
strategy:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ env:
ERT_SHOW_BACKTRACE: 1
ECL_SKIP_SIGNAL: 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
build-test-cmake:
name: Run C++ tests and coverage
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
tags: "*"
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
python-test-coverage:
name: Python Coverage
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/dark_storage_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ permissions:
# contents permission to update benchmark contents in gh-pages branch
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
benchmark:
name: Run pytest-benchmark dark storage
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/doctest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ on:
tags: "*"
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
python-doctest:
name:
name: Set up Python ${{ matrix.python-version }}
timeout-minutes: 40
runs-on: ubuntu-latest
strategy:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run_ert_test_data_setups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
ERT_SHOW_BACKTRACE: 1
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'version-**'
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
check-style:
timeout-minutes: 15
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_ert.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
type: string
test-type:
type: string
jobs:

jobs:
tests-ert:
name: Run ert tests
runs-on: ${{ inputs.os }}

timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_ert_with_slurm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
type: string
python-version:
type: string

jobs:
test-poly-on-slurm:
name: Run ert tests
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test_semeio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ name: Test Semeio

on: [pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
test-semeio:
name: Test Semeio
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/typing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
- 'version-**'
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
type-checking:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 21d8ae3

Please sign in to comment.