Skip to content

Commit

Permalink
Check wheel build in test
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromekelleher committed Aug 29, 2023
1 parent e1a6d56 commit 6b13e05
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 25 deletions.
41 changes: 34 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ jobs:
with:
python-version: '3.10'
- uses: pre-commit/[email protected]

test:
name: Python
name: Unit tests
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -39,17 +40,43 @@ jobs:
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
pip install pytest
pip install pytest-cov
pip install pytest-xdist
pip install -r requirements/CI-tests-pip/requirements.txt
python3 -m pip install -r requirements/CI-tests-pip/requirements.txt
- name: Test with pytest
run: |
pytest --cov=tstrait --cov-report=xml --cov-branch -n 0 tests
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Delete coverage
run: |
rm .coverage
rm .coverage
dist:
name: Distribution
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]

steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install build twine
- name: Build sdist and wheel
python -m build
- name: Check distribution artefacts
python3 -m twine check dist/*
- name: Install wheel and import package
run: |
python3 -m pip install dist/*.whl
python3 -c "import tstrait"
22 changes: 5 additions & 17 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,22 @@ jobs:
with:
python-version: 3.8

- name: Build sdist
- name: Build wheel and sdist
shell: bash
run: |
python setup.py sdist
python -m build
- name: Upload sdist
- name: Upload wheel and sdist
uses: actions/upload-artifact@v2
with:
name: sdist
path: dist

- name: Build wheels in docker
shell: bash
run: |
docker run --rm -v `pwd`:/project -w /project quay.io/pypa/manylinux2010_x86_64 bash .github/workflows/docker/buildwheel.sh
- name: Upload Wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: dist

OSX-test:
needs: ['manylinux']
runs-on: macos-latest
strategy:
matrix:
python: [3.7, 3.8, 3.9]
python: [3.8, 3.9, "3.10", "3.11"]
steps:
- name: Download wheels
uses: actions/download-artifact@v2
Expand All @@ -73,7 +61,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python: [3.7, 3.8, 3.9]
python: [3.8, 3.9, "3.10", "3.11"]
wordsize: [64]
steps:
- name: Download wheels
Expand Down
5 changes: 4 additions & 1 deletion requirements/CI-tests-pip/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ numba
numpy
pandas
scipy
tskit>=0.5.5
tskit>=0.5.5
pytest
pytest-cov
pytest-xdist

0 comments on commit 6b13e05

Please sign in to comment.