Skip to content

Commit 4fd5e30

Browse files
authored
Merge pull request #1186 from effigies/ci/fix_archive
CI: Cache git-archive separately from Python packages
2 parents b9c5451 + 62daa84 commit 4fd5e30

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

.github/workflows/stable.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,17 @@ jobs:
4646
run: python -m build
4747
- run: twine check dist/*
4848
- name: Build git archive
49-
run: git archive -v -o dist/nibabel-archive.tgz HEAD
50-
- uses: actions/upload-artifact@v3
49+
run: mkdir archive && git archive -v -o archive/nibabel-archive.tgz HEAD
50+
- name: Upload sdist and wheel artifacts
51+
uses: actions/upload-artifact@v3
5152
with:
5253
name: dist
5354
path: dist/
55+
- name: Upload git archive artifact
56+
uses: actions/upload-artifact@v3
57+
with:
58+
name: archive
59+
path: archive/
5460

5561
test-package:
5662
runs-on: ubuntu-latest
@@ -59,10 +65,18 @@ jobs:
5965
matrix:
6066
package: ['wheel', 'sdist', 'archive']
6167
steps:
62-
- uses: actions/download-artifact@v3
68+
- name: Download sdist and wheel artifacts
69+
if: matrix.package != 'archive'
70+
uses: actions/download-artifact@v3
6371
with:
6472
name: dist
6573
path: dist/
74+
- name: Download git archive artifact
75+
if: matrix.package == 'archive'
76+
uses: actions/download-artifact@v3
77+
with:
78+
name: archive
79+
path: archive/
6680
- uses: actions/setup-python@v4
6781
with:
6882
python-version: 3
@@ -71,14 +85,14 @@ jobs:
7185
- name: Update pip
7286
run: pip install --upgrade pip
7387
- name: Install wheel
74-
run: pip install dist/nibabel-*.whl
7588
if: matrix.package == 'wheel'
89+
run: pip install dist/nibabel-*.whl
7690
- name: Install sdist
77-
run: pip install dist/nibabel-*.tar.gz
7891
if: matrix.package == 'sdist'
92+
run: pip install dist/nibabel-*.tar.gz
7993
- name: Install archive
80-
run: pip install dist/nibabel-archive.tgz
8194
if: matrix.package == 'archive'
95+
run: pip install archive/nibabel-archive.tgz
8296
- run: python -c 'import nibabel; print(nibabel.__version__)'
8397
- name: Install test extras
8498
run: pip install nibabel[test]
@@ -165,17 +179,17 @@ jobs:
165179
- name: Install NiBabel
166180
run: tools/ci/install.sh
167181
- name: Run tests
168-
run: tools/ci/check.sh
169182
if: ${{ matrix.check != 'skiptests' }}
183+
run: tools/ci/check.sh
170184
- name: Submit coverage
171-
run: tools/ci/submit_coverage.sh
172185
if: ${{ always() }}
186+
run: tools/ci/submit_coverage.sh
173187
- name: Upload pytest test results
188+
if: ${{ always() && matrix.check == 'test' }}
174189
uses: actions/upload-artifact@v3
175190
with:
176191
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}
177192
path: for_testing/test-results.xml
178-
if: ${{ always() && matrix.check == 'test' }}
179193

180194
publish:
181195
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)