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 1a826e0
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions .github/workflows/build_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,35 @@ 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

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

- name: Extract source distribution
run: tar xf 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 1a826e0

Please sign in to comment.