Skip to content

Commit 2515e77

Browse files
agriyakhetarpaljs1tr3
authored andcommitted
Use unique artifact names (pybamm-team#4015)
* pybamm-team#3489 Use unique artifact names for all jobs * Limit benchmarks results to PyBaMM repo
1 parent c459817 commit 2515e77

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

@@ -133,19 +133,10 @@ jobs:
133133
CIBW_REPAIR_WHEEL_COMMAND_MACOS: delocate-listdeps {wheel} && delocate-wheel -v -w {dest_dir} {wheel}
134134
CIBW_TEST_COMMAND: python -c "import pybamm; pybamm.IDAKLUSolver()"
135135

136-
- name: Upload wheels for Linux
136+
- name: Upload wheels for ${{ matrix.os }}
137137
uses: actions/upload-artifact@v4
138-
if: matrix.os == 'ubuntu-latest'
139-
with:
140-
name: linux_wheels
141-
path: ./wheelhouse/*.whl
142-
if-no-files-found: error
143-
144-
- name: Upload wheels for macOS amd64
145-
uses: actions/upload-artifact@v4
146-
if: matrix.os == 'macos-12'
147138
with:
148-
name: macos_amd64_wheels
139+
name: wheels_${{ matrix.os }}
149140
path: ./wheelhouse/*.whl
150141
if-no-files-found: error
151142

@@ -179,7 +170,7 @@ jobs:
179170
- name: Upload wheels for macOS arm64
180171
uses: actions/upload-artifact@v4
181172
with:
182-
name: macos_arm64_wheels
173+
name: wheels_macos_arm64
183174
path: ./wheelhouse/*.whl
184175
if-no-files-found: error
185176

@@ -220,19 +211,20 @@ jobs:
220211
steps:
221212
- name: Download all artifacts
222213
uses: actions/download-artifact@v4
214+
with:
215+
path: artifacts
216+
merge-multiple: true
223217

224-
- name: Move all package files to files/
225-
run: |
226-
mkdir files
227-
mv windows_wheels/* linux_wheels/* macos_amd64_wheels/* macos_arm64_wheels/* sdist/* files/
218+
- name: Sanity check downloaded artifacts
219+
run: ls -lTA artifacts/
228220

229-
- name: Publish on PyPI
221+
- name: Publish to PyPI
230222
if: github.event.inputs.target == 'pypi' || github.event_name == 'release'
231223
uses: pypa/gh-action-pypi-publish@release/v1
232224
with:
233-
packages-dir: files/
225+
packages-dir: artifacts/
234226

235-
- name: Publish on TestPyPI
227+
- name: Publish to TestPyPI
236228
if: github.event.inputs.target == 'testpypi'
237229
uses: pypa/gh-action-pypi-publish@release/v1
238230
with:
@@ -242,7 +234,7 @@ jobs:
242234
repository-url: https://test.pypi.org/legacy/
243235

244236
open_failure_issue:
245-
needs: [build_windows_wheels, build_macos_and_linux_wheels, build_sdist]
237+
needs: [build_windows_wheels, build_macos_and_linux_wheels, build_macos_arm64_wheels, build_sdist]
246238
name: Open an issue if build fails
247239
if: ${{ always() && contains(needs.*.result, 'failure') && github.repository_owner == 'pybamm-team'}}
248240
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)