Skip to content

Commit

Permalink
Run tests from source distribution
Browse files Browse the repository at this point in the history
Doing so will ensure source distribution contain all necessary files to
execute the tests.

Since now we are performing more steps using the source distribution, it
makes sense to put this into a separate job as well.

Signed-off-by: Rodrigo Tobar <rtobar@icrar.org>
  • Loading branch information
rtobar committed Aug 26, 2024
1 parent b1366ec commit 88f9698
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,37 @@ jobs:
- name: Build sdist
run: python setup.py sdist

- name: Test sdist can be installed
run: pip install -v dist/*.tar.gz

- uses: actions/upload-artifact@v4
with:
name: source-dist
path: dist/*.tar.gz

test_sdist:
name: Check source distribution is usable
needs: [build_sdist]
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-python@v5
name: Install Python
with:
python-version: "3.12"

- uses: actions/download-artifact@v4
with:
name: source-dist

- name: Extract source distribution
run: tar xf crc32c*.tar.gz && rm crc32c*.tar.gz

- name: Install source distribution
run: pip install ./crc32c*

- name: Install test dependencies
run: pip install pytest

- name: Run source distribution tests
run: cd crc32c* && python run-tests.py

merge_artifacts:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
Expand Down

0 comments on commit 88f9698

Please sign in to comment.