- modernized packaging, now using pyproject.toml; #350
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: | |
push: | |
paths: | |
- src/** | |
- test/** | |
- setup.py | |
- requirements.txt | |
- Makefile | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
run-tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macos-latest, windows-latest ] | |
python: [ '3.8', '3.9', 'pypy-3.9', '3.10', '3.11', '3.12', '3.13' ] | |
include: | |
- os: macos-13 | |
python: '3.8' | |
- os: macos-13 | |
python: '3.9' | |
- os: macos-13 | |
python: 'pypy-3.9' | |
- os: macos-13 | |
python: '3.10' | |
- os: macos-13 | |
python: '3.11' | |
exclude: | |
- os: macos-latest # Python 3.8 unavailable on macos-14 | |
python: '3.8' | |
- os: macos-latest # Python 3.9 unavailable on macos-14 | |
python: '3.9' | |
- os: macos-latest # "ImportError: dlopen(.../probe.cpython-311-darwin.so, 0x002): bad bind opcode 0x00" | |
python: 'pypy-3.9' | |
- os: macos-latest # "ImportError: dlopen(.../probe.cpython-311-darwin.so, 0x002): bad bind opcode 0x00" | |
python: '3.10' | |
- os: macos-latest # "ImportError: dlopen(.../probe.cpython-311-darwin.so, 0x002): bad bind opcode 0x00" | |
python: '3.11' | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python }} | |
allow-prereleases: true | |
- name: install prereqs and SlipCover | |
run: | | |
python3 -m pip install wheel setuptools pytest | |
python3 -m pip install --no-use-pep517 . | |
- name: install Unix dependencies | |
if: matrix.os != 'windows-latest' | |
run: python3 -m pip install pytest-forked | |
- name: run tests | |
run: python3 -m pytest | |
# Test building from source distribution | |
test-build-from-source: | |
runs-on: ubuntu-latest | |
container: ${{ matrix.container }} | |
strategy: | |
matrix: | |
python_tag: ['cp311', 'pp39'] | |
include: | |
- os: ubuntu-latest | |
container: quay.io/pypa/manylinux2014_x86_64 # https://github.com/pypa/manylinux | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up python | |
run: | | |
PYT=`echo "${{ matrix.python_tag }}" | tr -d "."`; ls -d -1 /opt/python/$PYT-*/bin | head -n 1 >> $GITHUB_PATH | |
cat $GITHUB_PATH | |
- name: install dependencies | |
run: | | |
python3 -m pip install wheel | |
- name: build sdist | |
run: | | |
python3 setup.py sdist | |
- name: try to use it | |
run: | | |
tar xzf dist/slipcover*.tar.gz | |
cd slipcover* | |
python3 setup.py build | |
# Run a manylinux wheel build to verify build configuration | |
test-build-wheel-manylinux: | |
runs-on: ubuntu-latest | |
container: ${{ matrix.container }} | |
strategy: | |
matrix: | |
python_version: ['3.8', '3.9', '3.10', '3.11'] # 3.12+ are "pure Python", no need to build on manylinux | |
include: | |
- os: ubuntu-latest | |
container: quay.io/pypa/manylinux2014_x86_64 # https://github.com/pypa/manylinux | |
steps: | |
- uses: actions/checkout@v3 | |
- name: set up python | |
run: | | |
PYV=`echo "${{ matrix.python_version }}" | tr -d "."`; ls -d -1 /opt/python/cp$PYV*/bin | head -n 1 >> $GITHUB_PATH | |
cat $GITHUB_PATH | |
- name: install dependencies | |
run: | | |
python3 -m pip install --upgrade pip # otherwise building 'cryptography' may fail | |
python3 -m pip install setuptools wheel twine | |
- name: build wheel | |
run: | | |
python3 setup.py bdist_wheel | |
- name: run auditwheel for manylinux | |
run: | | |
auditwheel repair dist/*.whl | |
rm -f dist/*.whl | |
mv wheelhouse/*.whl dist/ |