Use latest injector version/repo #195
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: | |
workflow_dispatch: | |
inputs: | |
deploy: | |
description: 'Release this branch' | |
required: false | |
type: boolean | |
release: | |
types: [ created ] | |
pull_request: | |
jobs: | |
test_alpine: | |
runs-on: ubuntu-latest | |
container: ${{ matrix.container }} | |
strategy: | |
fail-fast: false | |
matrix: | |
container: | |
- "python:3.8-alpine" | |
- "python:3.9-alpine" | |
- "python:3.10-alpine" | |
- "python:3.11-alpine" | |
- "python:3.12-alpine" | |
steps: | |
- name: Install packages | |
# gcc and musl-dev needed for compiling the package | |
# git needed for checkout | |
# patchelf needed for auditwheel | |
run: apk add gcc musl-dev git patchelf | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: pip install tox==4.16.0 tox-gh==1.3.2 auditwheel==6.0.0 | |
- name: Test with tox | |
run: python -m tox | |
- name: Audit wheel | |
run: auditwheel repair .tox/.pkg/dist/*.whl -w audited_wheels | |
- name: Upload wheel | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: audited_wheels/* | |
test_manylinux: | |
runs-on: ubuntu-latest | |
# Need a relatively modern platform (2014) for the actions themselves to work | |
container: quay.io/pypa/manylinux_2_28_x86_64 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [cp38-cp38, cp39-cp39, cp310-cp310, cp311-cp311, cp312-cp312] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Python | |
run: | | |
echo "/opt/python/${{ matrix.python-version }}/bin" >> $GITHUB_PATH | |
echo $PATH | |
- name: Install dependencies | |
run: pip install tox==4.16.0 tox-gh==1.3.2 | |
- name: Test wheel with tox | |
run: python -m tox | |
- name: Audit wheel | |
run: auditwheel repair .tox/.pkg/dist/*.whl -w audited_wheels | |
- name: Upload wheel | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: audited_wheels/* | |
test_windows: | |
runs-on: windows-2019 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | |
arch: [x86, x64] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.arch }} | |
- name: Install dependencies | |
run: pip install tox==4.16.0 tox-gh==1.3.2 | |
- name: Test with tox | |
run: python -m tox | |
- name: Upload wheel | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: .tox/.pkg/dist/* | |
test_mac: | |
runs-on: macos-13 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ "3.11", "3.12" ] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pip install tox==4.16.0 tox-gh==1.3.2 | |
- name: Test with tox | |
run: sudo python -m tox -e sdist | |
- name: Upload dist | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: .tox/.pkg/dist/* | |
publish: | |
if: (github.event_name == 'release' && github.event.action == 'created') || inputs.deploy | |
needs: [test_windows, test_manylinux, test_alpine] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: dist | |
path: dist | |
- name: Publish | |
env: | |
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: | | |
python -m pip install twine | |
python -m twine check dist/* | |
python -m twine upload --skip-existing dist/* |