Skip to content

Commit cd48237

Browse files
committed
ci: Update "cd.yml" adding "test_sdist" and "check_dist" jobs
Adapted from https://github.com/scikit-build/cmake-python-distributions
1 parent 792c6ca commit cd48237

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

.github/workflows/cd.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,51 @@ jobs:
3030
name: cibw-sdist
3131
path: dist/*.tar.gz
3232

33+
test_sdist:
34+
name: Test SDist with python ${{ matrix.python }}
35+
needs: [make_sdist]
36+
runs-on: ubuntu-latest
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
python: ["3.8", "3.12"]
41+
42+
steps:
43+
- uses: actions/checkout@v4
44+
- uses: actions/setup-python@v5
45+
name: Install Python ${{ matrix.python }}
46+
with:
47+
python-version: ${{ matrix.python }}
48+
49+
- name: Install dependencies
50+
run: |
51+
pip install pytest pytest-cov
52+
53+
- uses: actions/download-artifact@v4
54+
with:
55+
name: cibw-sdist
56+
path: dist
57+
58+
- name: Install SDist
59+
run: |
60+
pip -V
61+
pip install dist/*.tar.gz
62+
rm -rf dist
63+
64+
- name: Test installed SDist
65+
run: pytest ./tests
66+
67+
check_dist:
68+
name: Check dist
69+
needs: [build_wheels, make_sdist, test_sdist]
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/download-artifact@v4
73+
with:
74+
path: all
75+
76+
- run: pipx run twine check --strict all/*/*
77+
3378
build_wheels:
3479
name: Wheel on ${{ matrix.os }}
3580
runs-on: ${{ matrix.os }}
@@ -52,7 +97,7 @@ jobs:
5297
path: wheelhouse/*.whl
5398

5499
upload_all:
55-
needs: [build_wheels, make_sdist]
100+
needs: [check_dist]
56101
environment: pypi
57102
permissions:
58103
id-token: write

0 commit comments

Comments
 (0)