Skip to content

Commit 968e8b4

Browse files
Merge pull request #1625 from OceanStreamIO/oceanstream/ci-pip-cache-concurrency
ci: add pip caching, concurrency groups, and auto worker count
2 parents 97a8769 + 04b7d70 commit 968e8b4

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/build.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@ on:
77
paths-ignore: ["**/docker.yaml"]
88
workflow_dispatch:
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
1014
env:
11-
NUM_WORKERS: 2
15+
NUM_WORKERS: auto
1216
USE_POOCH: "True"
1317
ECHOPYPE_DATA_VERSION: v0.11.1a2
1418
ECHOPYPE_DATA_BASEURL: https://github.com/OSOceanAcoustics/echopype/releases/download/{version}/
@@ -67,6 +71,7 @@ jobs:
6771
uses: actions/setup-python@v6.2.0
6872
with:
6973
python-version: ${{ matrix.python-version }}
74+
cache: pip
7075

7176
- name: System usage (baseline)
7277
if: runner.os == 'Linux'

.github/workflows/pr.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ on:
88
- ci/*
99
workflow_dispatch:
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
13+
cancel-in-progress: true
1114

1215
env:
13-
NUM_WORKERS: 2
16+
NUM_WORKERS: auto
1417
USE_POOCH: "True"
1518
ECHOPYPE_DATA_VERSION: v0.11.1a2
1619
ECHOPYPE_DATA_BASEURL: https://github.com/OSOceanAcoustics/echopype/releases/download/{version}/
@@ -71,7 +74,7 @@ jobs:
7174
uses: actions/setup-python@v6.2.0
7275
with:
7376
python-version: ${{ matrix.python-version }}
74-
77+
cache: pip
7578

7679
- name: Upgrade pip
7780
run: python -m pip install --upgrade pip
@@ -168,6 +171,7 @@ jobs:
168171
- uses: actions/setup-python@v6.2.0
169172
with:
170173
python-version: ${{ matrix.python-version }}
174+
cache: pip
171175

172176
- name: Upgrade pip
173177
run: python -m pip install --upgrade pip

0 commit comments

Comments
 (0)