Skip to content

Commit 2d52f68

Browse files
authored
Merge pull request #34 from VirtualPlanetaryLaboratory/comprehensive-testing
Fix pip-install workflow to prevent artifact corruption
2 parents 829ac0d + 8e0340a commit 2d52f68

2 files changed

Lines changed: 31 additions & 17 deletions

File tree

.github/workflows/pip-install.yml

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,8 @@ on:
88
jobs:
99

1010
build:
11-
name: 'py${{ matrix.python }} on ${{ matrix.os }}'
12-
runs-on: ${{ matrix.os }}
13-
strategy:
14-
matrix:
15-
os: [macos-15-intel, macos-26, ubuntu-22.04, ubuntu-24.04]
16-
python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
11+
name: Build distribution
12+
runs-on: ubuntu-latest
1713
steps:
1814
- uses: actions/checkout@v4
1915
with:
@@ -23,14 +19,38 @@ jobs:
2319
- uses: actions/setup-python@v5
2420
name: Install Python
2521
with:
26-
python-version: ${{ matrix.python }}
27-
allow-prereleases: true
22+
python-version: '3.11'
2823

2924
- name: Build
3025
run: |
3126
python -m pip install -U pip build twine setuptools setuptools_scm wheel
3227
python -m build
3328
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: dist
32+
path: dist/*
33+
34+
test:
35+
name: 'Test py${{ matrix.python }} on ${{ matrix.os }}'
36+
needs: [build]
37+
runs-on: ${{ matrix.os }}
38+
strategy:
39+
matrix:
40+
os: [macos-15-intel, macos-26, ubuntu-22.04, ubuntu-24.04]
41+
python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
42+
steps:
43+
- uses: actions/download-artifact@v4
44+
with:
45+
name: dist
46+
path: dist
47+
48+
- uses: actions/setup-python@v5
49+
name: Install Python
50+
with:
51+
python-version: ${{ matrix.python }}
52+
allow-prereleases: true
53+
3454
- name: Test the sdist
3555
run: |
3656
python -m venv venv-sdist
@@ -43,22 +63,16 @@ jobs:
4363
venv-wheel/bin/python -m pip install dist/vspace*.whl
4464
venv-wheel/bin/python -c "import vspace; print(vspace.__version__)"
4565
46-
- uses: actions/upload-artifact@v4
47-
with:
48-
name: dist-${{ matrix.os }}-${{ matrix.python }}
49-
path: dist/*
50-
5166
upload_pypi:
52-
needs: [build]
67+
needs: [build, test]
5368
runs-on: ubuntu-latest
5469
if: github.event_name == 'release' && github.event.action == 'published'
5570
permissions:
5671
id-token: write
5772
steps:
5873
- uses: actions/download-artifact@v4
5974
with:
60-
pattern: dist-*
75+
name: dist
6176
path: dist
62-
merge-multiple: true
6377

6478
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
os: [ubuntu-22.04, ubuntu-24.04, macos-15-intel, macos-latest]
14+
os: [ubuntu-22.04, ubuntu-24.04, macos-15-intel, macos-26]
1515
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1616

1717
steps:

0 commit comments

Comments
 (0)