Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster workflow response / saving resources via timeout/concurrency policy #316

Merged
merged 1 commit into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/caching-envs-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
caching-example:
name: Caching-Env
Expand All @@ -27,6 +32,7 @@ jobs:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]

runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/caching-example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
caching-example:
# prevent cronjobs from running on forks
Expand All @@ -21,6 +26,7 @@ jobs:
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule')
name: Caching
runs-on: "ubuntu-latest"
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Cache conda
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/example-1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
example-1:
# prevent cronjobs from running on forks
Expand All @@ -26,6 +31,7 @@ jobs:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.8", "3.11"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/example-10.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
example-10-miniforge:
# prevent cronjobs from running on forks
Expand Down Expand Up @@ -76,6 +81,7 @@ jobs:
- os: macos
miniforge-variant: Mambaforge
miniforge-version: "23.3.1-1"
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/example-11.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
example-11:
# prevent cronjobs from running on forks
Expand All @@ -29,6 +34,7 @@ jobs:
os: ["ubuntu-latest", "windows-latest"]
architecture: ["x86"]
miniconda-version: ["latest"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/example-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
example-2-linux:
# prevent cronjobs from running on forks
Expand All @@ -21,6 +26,7 @@ jobs:
'conda-incubator/setup-miniconda') || (github.event_name != 'schedule')
name: Ex2 Linux
runs-on: "ubuntu-latest"
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand All @@ -43,6 +49,7 @@ jobs:
example-2-mac:
name: Ex2 Mac
runs-on: "macos-latest"
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down Expand Up @@ -71,6 +78,7 @@ jobs:
example-2-win:
name: Ex2 Windows
runs-on: "windows-latest"
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/example-3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
example-3:
# prevent cronjobs from running on forks
Expand All @@ -24,6 +29,7 @@ jobs:
defaults:
run:
shell: bash -el {0}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand All @@ -45,6 +51,7 @@ jobs:
defaults:
run:
shell: bash -el {0}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/example-4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
example-4:
# prevent cronjobs from running on forks
Expand All @@ -24,6 +29,7 @@ jobs:
defaults:
run:
shell: bash -el {0}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/example-5.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
example-5-linux:
# prevent cronjobs from running on forks
Expand All @@ -26,6 +31,7 @@ jobs:
defaults:
run:
shell: bash -el {0}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- run: |
Expand All @@ -50,6 +56,7 @@ jobs:
defaults:
run:
shell: bash -el {0}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand All @@ -68,6 +75,7 @@ jobs:
example-5-win:
name: Ex5 Windows
runs-on: "windows-latest"
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/example-6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
example-6:
# prevent cronjobs from running on forks
Expand All @@ -35,6 +40,7 @@ jobs:
defaults:
run:
shell: bash -el {0}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/example-7.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
example-7:
# prevent cronjobs from running on forks
Expand All @@ -28,6 +33,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/example-8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
example-8:
# prevent cronjobs from running on forks
Expand All @@ -26,6 +31,7 @@ jobs:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.8", "3.11"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/example-9.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
example-9:
# prevent cronjobs from running on forks
Expand All @@ -26,6 +31,7 @@ jobs:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.8", "3.11"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,16 @@ on:
- "main"
- "master"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
lint:
name: Lint
runs-on: "ubuntu-latest"
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -27,6 +33,7 @@ jobs:
build:
name: Build
runs-on: "ubuntu-latest"
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/regression-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ on:
# Note that cronjobs run on master/main by default
- cron: "0 0 * * *"

concurrency:
group:
${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

jobs:
issue-114:
# prevent cronjobs from running on forks
Expand All @@ -29,6 +34,7 @@ jobs:
matrix:
os: ["ubuntu", "macos", "windows"]
python-version: ["3.9"]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: ./
Expand Down