Skip to content

Commit 11eb9f4

Browse files
committed
fixup! Add an sdist test inclusion smoke test
1 parent eb0170a commit 11eb9f4

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,62 @@ jobs:
7878
dist/${{ steps.artifact-name.outputs.wheel }}
7979
retention-days: 5
8080

81+
- name: >-
82+
Smoke-test:
83+
retrieve the project source from an sdist inside the GHA artifact
84+
uses: re-actors/checkout-python-sdist@release/v2
85+
with:
86+
source-tarball-name: ${{ needs.build.outputs.sdist-artifact-name }}
87+
workflow-artifact-name: ${{ env.dists-artifact-name }}
88+
89+
- name: >-
90+
Smoke-test: move the sdist-retrieved dir into sdist-src
91+
run: |
92+
mv -v '${{ github.workspace }}' '${{ runner.temp }}/sdist-src'
93+
mkdir -pv '${{ github.workspace }}'
94+
mv -v '${{ runner.temp }}/sdist-src' '${{ github.workspace }}/sdist-src'
95+
shell: bash -eEuo pipefail {0}
96+
97+
- name: >-
98+
Smoke-test: grab the source from Git into git-src
99+
uses: actions/checkout@v4
100+
with:
101+
path: git-src
102+
103+
- name: >-
104+
Smoke-test: install test requirements from the Git repo
105+
run: python -Im pip install pytest -c test-requirements.txt
106+
shell: bash -eEuo pipefail {0}
107+
working-directory: git-src
108+
109+
- name: >-
110+
Smoke-test: collect tests from the Git repo
111+
env:
112+
PYTHONPATH: src/
113+
run: >-
114+
pytest --collect-only -qq .
115+
| sort
116+
| tee collected-tests
117+
shell: bash -eEuo pipefail {0}
118+
working-directory: git-src
119+
120+
- name: >-
121+
Smoke-test: collect tests from the sdist tarball
122+
env:
123+
PYTHONPATH: src/
124+
run: >-
125+
pytest --collect-only -qq .
126+
| sort
127+
| tee collected-tests
128+
shell: bash -eEuo pipefail {0}
129+
working-directory: sdist-src
130+
131+
- name: >-
132+
Smoke-test:
133+
verify that all the tests from Git are included in the sdist
134+
run: diff --unified sdist-src/collected-tests git-src/collected-tests
135+
shell: bash -eEuo pipefail {0}
136+
81137
Windows:
82138
name: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }})'
83139
needs:

0 commit comments

Comments
 (0)