Skip to content

Commit 4d0b545

Browse files
committed
Migrate to new artifact action API
Signed-off-by: Keith Battocchi <[email protected]>
1 parent 690d370 commit 4d0b545

File tree

3 files changed

+56
-26
lines changed

3 files changed

+56
-26
lines changed

.github/workflows/ci.yml

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,9 @@ jobs:
155155
- name: Save installed packages
156156
run: pip freeze --exclude-editable > notebooks-${{ env.id_string }}-requirements.txt
157157
- name: Upload installed packages
158-
uses: actions/upload-artifact@v3
158+
uses: actions/upload-artifact@v4
159159
with:
160-
name: requirements
160+
name: requirements-${{ env.id_string }}
161161
path: notebooks-${{ env.id_string }}-requirements.txt
162162
- name: Install pytest
163163
run: uv pip install --system pytest pytest-xdist pytest-cov coverage[toml]
@@ -173,26 +173,26 @@ jobs:
173173
# Run whether or not the tests passed, but only if they ran at all
174174
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
175175
- name: Upload coverage report
176-
uses: actions/upload-artifact@v3
176+
uses: actions/upload-artifact@v4
177177
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
178178
with:
179-
name: coverage
179+
name: coverage-${{ env.id_string }}
180180
path: .coverage.${{ env.id_string }}
181181
- name: Make test XML filename unique
182182
run: mv junit/test-results.xml ${{ env.id_string }}-test-results.xml
183183
# Run whether or not the tests passed, but only if they ran at all
184184
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
185185
- name: Upload test XML files
186-
uses: actions/upload-artifact@v3
186+
uses: actions/upload-artifact@v4
187187
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
188188
with:
189-
name: tests
189+
name: tests-${{ env.id_string }}
190190
path: ${{ env.id_string }}-test-results.xml
191191
- name: Upload notebook outputs
192-
uses: actions/upload-artifact@v3
192+
uses: actions/upload-artifact@v4
193193
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
194194
with:
195-
name: notebooks
195+
name: notebooks-${{ env.id_string }}
196196
path: notebooks/output/
197197

198198
tests:
@@ -256,9 +256,9 @@ jobs:
256256
- name: Save installed packages
257257
run: pip freeze --exclude-editable > tests-${{ env.id_string }}-requirements.txt
258258
- name: Upload installed packages
259-
uses: actions/upload-artifact@v3
259+
uses: actions/upload-artifact@v4
260260
with:
261-
name: requirements
261+
name: requirements-${{ env.id_string }}
262262
path: tests-${{ env.id_string }}-requirements.txt
263263
- name: Install pytest
264264
run: uv pip install --system pytest pytest-xdist pytest-cov coverage[toml]
@@ -273,20 +273,20 @@ jobs:
273273
# Run whether or not the tests passed, but only if they ran at all
274274
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
275275
- name: Upload coverage report
276-
uses: actions/upload-artifact@v3
276+
uses: actions/upload-artifact@v4
277277
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
278278
with:
279-
name: coverage
279+
name: coverage-${{ env.id_string }}
280280
path: .coverage.${{ env.id_string }}
281281
- name: Make test XML filename unique
282282
run: mv junit/test-results.xml ${{ env.id_string }}-test-results.xml
283283
# Run whether or not the tests passed, but only if they ran at all
284284
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
285285
- name: Upload test XML files
286-
uses: actions/upload-artifact@v3
286+
uses: actions/upload-artifact@v4
287287
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
288288
with:
289-
name: tests
289+
name: tests-${{ env.id_string }}
290290
path: ${{ env.id_string }}-test-results.xml
291291

292292
coverage-report:
@@ -300,10 +300,11 @@ jobs:
300300
with:
301301
ref: ${{ env.ref }}
302302
- name: Get coverage reports
303-
uses: actions/download-artifact@v3
303+
uses: actions/download-artifact@v4
304304
with:
305-
name: coverage
305+
pattern: coverage-*
306306
path: coverage
307+
merge-multiple: true
307308
- name: Setup Python
308309
uses: actions/setup-python@v5
309310
with:
@@ -317,11 +318,27 @@ jobs:
317318
- name: Generate coverage html --fail-under=86
318319
run: coverage html
319320
- name: Upload coverage report
320-
uses: actions/upload-artifact@v3
321+
uses: actions/upload-artifact@v4
321322
with:
322-
name: coverage
323+
name: coverage-report
323324
path: htmlcov
324325

326+
merge-artifacts:
327+
name: "Merge artifacts"
328+
needs: [coverage-report, tests, notebooks]
329+
if: success() || failure()
330+
strategy:
331+
matrix:
332+
artifact: [requirements, tests, coverage, notebooks]
333+
runs-on: ubuntu-latest
334+
steps:
335+
- name: "Merge artifacts"
336+
uses: actions/upload-artifact/merge@v4
337+
with:
338+
name: ${{ matrix.artifact }}
339+
pattern: "${{ matrix.artifact }}-*"
340+
delete-merged: true
341+
325342
build:
326343
name: Build package
327344
needs: [eval]

.github/workflows/publish-documentation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
- name: Build documentation
8282
run: pip install "sphinx~=4.4.0" "sphinx_rtd_theme~=1.0.0" && python setup.py build_sphinx -W
8383
- name: Upload docs as artifact
84-
uses: actions/upload-artifact@v3
84+
uses: actions/upload-artifact@v4
8585
with:
8686
name: docs
8787
path: build/sphinx/html/
@@ -108,7 +108,7 @@ jobs:
108108
zip -r docs.zip *
109109
popd
110110
- name: Login to Azure
111-
uses: azure/login@v1
111+
uses: azure/login@v2
112112
with:
113113
client-id: ${{ secrets.AZURE_CLIENT_ID }}
114114
tenant-id: ${{ secrets.AZURE_TENANT_ID }}

.github/workflows/publish-package.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ jobs:
7474
CIBW_BUILD: cp3*
7575
CIBW_SKIP: "*musl* *win32 *i686"
7676
- name: Upload wheels as artifact
77-
uses: actions/upload-artifact@v3
77+
uses: actions/upload-artifact@v4
7878
with:
79-
name: dist
79+
name: dist-${{ matrix.os }}
8080
path: dist/
8181
build_sdist:
8282
name: Build sdist
@@ -97,13 +97,26 @@ jobs:
9797
- name: Build sdist
9898
run: python setup.py sdist
9999
- name: Upload sdist as artifact
100-
uses: actions/upload-artifact@v3
100+
uses: actions/upload-artifact@v4
101101
with:
102-
name: dist
102+
name: dist-sdist
103103
path: dist/
104+
105+
merge:
106+
name: Merge artifacts
107+
needs: [build_wheels, build_sdist]
108+
runs-on: ubuntu-latest
109+
steps:
110+
- name: "Merge artifacts"
111+
uses: actions/upload-artifact/merge@v4
112+
with:
113+
name: dist
114+
pattern: dist-*
115+
delete-merged: true
116+
104117
publish:
105118
name: Publish to PyPI or TestPyPI
106-
needs: [build_wheels, build_sdist]
119+
needs: [merge]
107120
runs-on: ubuntu-latest
108121
steps:
109122
- name: Setup Python
@@ -115,7 +128,7 @@ jobs:
115128
- name: Install twine
116129
run: pip install twine
117130
- name: Download wheels and sdist
118-
uses: actions/download-artifact@v3
131+
uses: actions/download-artifact@v4
119132
with:
120133
name: dist
121134
path: dist/

0 commit comments

Comments
 (0)