From bc0512866791b661b94b4a1a87f072c5101d0ef9 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Fri, 20 Dec 2024 04:22:10 +0100 Subject: [PATCH] fixup! Add an sdist test inclusion smoke test --- .github/workflows/ci.yml | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dfd1ced16..6a5cfab0f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,6 +78,62 @@ jobs: dist/${{ steps.artifact-name.outputs.wheel }} retention-days: 5 + - name: >- + Smoke-test: + retrieve the project source from an sdist inside the GHA artifact + uses: re-actors/checkout-python-sdist@release/v2 + with: + source-tarball-name: ${{ steps.artifact-name.outputs.sdist }} + workflow-artifact-name: ${{ env.dists-artifact-name }} + + - name: >- + Smoke-test: move the sdist-retrieved dir into sdist-src + run: | + mv -v '${{ github.workspace }}' '${{ runner.temp }}/sdist-src' + mkdir -pv '${{ github.workspace }}' + mv -v '${{ runner.temp }}/sdist-src' '${{ github.workspace }}/sdist-src' + shell: bash -eEuo pipefail {0} + + - name: >- + Smoke-test: grab the source from Git into git-src + uses: actions/checkout@v4 + with: + path: git-src + + - name: >- + Smoke-test: install test requirements from the Git repo + run: python -Im pip install pytest -c test-requirements.txt + shell: bash -eEuo pipefail {0} + working-directory: git-src + + - name: >- + Smoke-test: collect tests from the Git repo + env: + PYTHONPATH: src/ + run: >- + pytest --collect-only -qq . + | sort + | tee collected-tests + shell: bash -eEuo pipefail {0} + working-directory: git-src + + - name: >- + Smoke-test: collect tests from the sdist tarball + env: + PYTHONPATH: src/ + run: >- + pytest --collect-only -qq . + | sort + | tee collected-tests + shell: bash -eEuo pipefail {0} + working-directory: sdist-src + + - name: >- + Smoke-test: + verify that all the tests from Git are included in the sdist + run: diff --unified sdist-src/collected-tests git-src/collected-tests + shell: bash -eEuo pipefail {0} + Windows: name: 'Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }})' needs: