Skip to content

Commit b0bc5cf

Browse files
Use unique artifact names (#4015)
* #3489 Use unique artifact names for all jobs * Limit benchmarks results to PyBaMM repo
1 parent cf09d5e commit b0bc5cf

File tree

3 files changed

+31
-29
lines changed

3 files changed

+31
-29
lines changed

.github/workflows/periodic_benchmarks.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ jobs:
5252
with:
5353
name: asv_periodic_results
5454
path: results
55+
if-no-files-found: error
5556

5657
publish-results:
58+
if: github.repository == 'pybamm-team/PyBaMM'
5759
name: Push and publish results
5860
needs: benchmarks
5961
runs-on: ubuntu-latest
@@ -72,18 +74,17 @@ jobs:
7274
repository: pybamm-team/pybamm-bench
7375
token: ${{ secrets.BENCH_PAT }}
7476

75-
- name: Download results artifact
77+
- name: Download results artifact(s)
7678
uses: actions/download-artifact@v4
7779
with:
78-
name: asv_periodic_results
79-
path: new_results
80+
path: results
81+
merge-multiple: true
8082

8183
- name: Copy new results and push to pybamm-bench repo
8284
env:
8385
PUSH_BENCH_EMAIL: ${{ secrets.PUSH_BENCH_EMAIL }}
8486
PUSH_BENCH_NAME: ${{ secrets.PUSH_BENCH_NAME }}
8587
run: |
86-
cp -vr new_results/* results
8788
git config --global user.email "$PUSH_BENCH_EMAIL"
8889
git config --global user.name "$PUSH_BENCH_NAME"
8990
git add results

.github/workflows/publish_pypi.yml

+13-21
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
- name: Upload Windows wheels
9090
uses: actions/upload-artifact@v4
9191
with:
92-
name: windows_wheels
92+
name: wheels_windows
9393
path: ./wheelhouse/*.whl
9494
if-no-files-found: error
9595

@@ -142,19 +142,10 @@ jobs:
142142
CIBW_REPAIR_WHEEL_COMMAND_MACOS: delocate-listdeps {wheel} && delocate-wheel -v -w {dest_dir} {wheel}
143143
CIBW_TEST_COMMAND: python -c "import pybamm; pybamm.IDAKLUSolver()"
144144

145-
- name: Upload wheels for Linux
145+
- name: Upload wheels for ${{ matrix.os }}
146146
uses: actions/upload-artifact@v4
147-
if: matrix.os == 'ubuntu-latest'
148-
with:
149-
name: linux_wheels
150-
path: ./wheelhouse/*.whl
151-
if-no-files-found: error
152-
153-
- name: Upload wheels for macOS amd64
154-
uses: actions/upload-artifact@v4
155-
if: matrix.os == 'macos-12'
156147
with:
157-
name: macos_amd64_wheels
148+
name: wheels_${{ matrix.os }}
158149
path: ./wheelhouse/*.whl
159150
if-no-files-found: error
160151

@@ -188,7 +179,7 @@ jobs:
188179
- name: Upload wheels for macOS arm64
189180
uses: actions/upload-artifact@v4
190181
with:
191-
name: macos_arm64_wheels
182+
name: wheels_macos_arm64
192183
path: ./wheelhouse/*.whl
193184
if-no-files-found: error
194185

@@ -227,19 +218,20 @@ jobs:
227218
steps:
228219
- name: Download all artifacts
229220
uses: actions/download-artifact@v4
221+
with:
222+
path: artifacts
223+
merge-multiple: true
230224

231-
- name: Move all package files to files/
232-
run: |
233-
mkdir files
234-
mv windows_wheels/* linux_wheels/* macos_amd64_wheels/* macos_arm64_wheels/* sdist/* files/
225+
- name: Sanity check downloaded artifacts
226+
run: ls -lTA artifacts/
235227

236-
- name: Publish on PyPI
228+
- name: Publish to PyPI
237229
if: github.event.inputs.target == 'pypi' || github.event_name == 'release'
238230
uses: pypa/gh-action-pypi-publish@release/v1
239231
with:
240-
packages-dir: files/
232+
packages-dir: artifacts/
241233

242-
- name: Publish on TestPyPI
234+
- name: Publish to TestPyPI
243235
if: github.event.inputs.target == 'testpypi'
244236
uses: pypa/gh-action-pypi-publish@release/v1
245237
with:
@@ -249,7 +241,7 @@ jobs:
249241
repository-url: https://test.pypi.org/legacy/
250242

251243
open_failure_issue:
252-
needs: [build_windows_wheels, build_macos_and_linux_wheels, build_sdist]
244+
needs: [build_windows_wheels, build_macos_and_linux_wheels, build_macos_arm64_wheels, build_sdist]
253245
name: Open an issue if build fails
254246
if: ${{ always() && contains(needs.*.result, 'failure') && github.repository_owner == 'pybamm-team'}}
255247
runs-on: ubuntu-latest

.github/workflows/run_benchmarks_over_history.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,30 @@ jobs:
2727
uses: actions/setup-python@v5
2828
with:
2929
python-version: 3.12
30+
3031
- name: Install nox and asv
3132
run: pip install -U pip nox asv
33+
3234
- name: Fetch develop branch
3335
# Not required when worklow trigerred
3436
# on develop, but useful when
3537
# experimenting/developing on another branch.
3638
if: github.ref != 'refs/heads/develop'
3739
run: |
3840
git fetch origin develop:develop
41+
3942
- name: Run benchmarks
4043
run: |
4144
asv machine --machine "GitHubRunner"
4245
asv run -m "GitHubRunner" -s ${{ github.event.inputs.ncommits }} \
4346
${{ github.event.inputs.commit_start }}..${{ github.event.inputs.commit_end }}
47+
4448
- name: Upload results as artifact
4549
uses: actions/upload-artifact@v4
4650
with:
4751
name: asv_over_history_results
4852
path: results
53+
if-no-files-found: error
4954

5055
publish-results:
5156
if: github.repository_owner == 'pybamm-team'
@@ -57,29 +62,33 @@ jobs:
5762
uses: actions/setup-python@v5
5863
with:
5964
python-version: 3.12
65+
6066
- name: Install asv
6167
run: pip install asv
68+
6269
- name: Checkout pybamm-bench repo
6370
uses: actions/checkout@v4
6471
with:
6572
repository: pybamm-team/pybamm-bench
6673
token: ${{ secrets.BENCH_PAT }}
67-
- name: Download results artifact
74+
75+
- name: Download results artifact(s)
6876
uses: actions/download-artifact@v4
6977
with:
70-
name: asv_over_history_results
71-
path: new_results
78+
path: results
79+
merge-multiple: true
80+
7281
- name: Copy new results and push to pybamm-bench repo
7382
env:
7483
PUSH_BENCH_EMAIL: ${{ secrets.PUSH_BENCH_EMAIL }}
7584
PUSH_BENCH_NAME: ${{ secrets.PUSH_BENCH_NAME }}
7685
run: |
77-
cp -vr new_results/* results
7886
git config --global user.email "$PUSH_BENCH_EMAIL"
7987
git config --global user.name "$PUSH_BENCH_NAME"
8088
git add results
8189
git commit -am "Add new results"
8290
git push
91+
8392
- name: Publish results
8493
run: |
8594
asv publish

0 commit comments

Comments
 (0)