Skip to content

Commit 5a63e5d

Browse files
committed
chore(ci): Test sdist to ensure all necessary files are packaged
1 parent 13e995a commit 5a63e5d

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ permissions:
3232
contents: read
3333

3434
jobs:
35+
build:
36+
name: Build & verify package
37+
runs-on: ubuntu-latest
38+
permissions:
39+
attestations: write
40+
id-token: write
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
fetch-depth: 0
45+
- uses: hynek/build-and-inspect-python-package@v2
46+
with:
47+
attest-build-provenance-github: ${{ github.event_name != 'pull_request' }}
48+
3549
test:
3650
# Check each OS, all supported Python, minimum versions and latest releases
3751
runs-on: ${{ matrix.os }}
@@ -40,10 +54,16 @@ jobs:
4054
os: ['ubuntu-latest', 'macos-latest']
4155
python-version: ['3.9', '3.10', '3.11', '3.12']
4256
dependencies: ['full', 'pre']
57+
source: ['repo']
4358
include:
4459
- os: ubuntu-latest
4560
python-version: '3.9'
4661
dependencies: min
62+
source: 'repo'
63+
- os: ubuntu-latest
64+
python-version: '3'
65+
dependencies: full
66+
source: 'sdist'
4767
exclude:
4868
# Drop pre tests for SPEC-0-unsupported Python versions
4969
# See https://scientific-python.org/specs/spec-0000/
@@ -58,9 +78,19 @@ jobs:
5878

5979
steps:
6080
- uses: actions/checkout@v4
81+
if: matrix.source == 'repo'
6182
with:
6283
submodules: recursive
6384
fetch-depth: 0
85+
- name: Download packages built by build-and-inspect-python-package
86+
if: matrix.source == 'sdist'
87+
uses: actions/download-artifact@v4
88+
with:
89+
name: Packages
90+
path: dist
91+
- name: Extract sdist
92+
if: matrix.source == 'sdist'
93+
run: tar --strip-leading-components=1 -xzf dist/*.tar.gz
6494
- name: Set up Python ${{ matrix.python-version }}
6595
uses: actions/setup-python@v5
6696
with:

0 commit comments

Comments
 (0)