chore: update tox to fix CI #160
Workflow file for this run
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 ] | |
push: | |
pull_request: | |
jobs: | |
test_manylinux: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: pip install tox==4.11.0 tox-gh==1.3.2 | |
- name: Test with tox | |
run: python -m tox | |
- name: Upload dists | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist | |
path: .tox/.pkg/dist/* | |
test_alpine: | |
runs-on: ubuntu-latest | |
container: ${{ matrix.container }} | |
strategy: | |
fail-fast: false | |
matrix: | |
container: | |
- "python:3.7-alpine" | |
- "python:3.8-alpine" | |
- "python:3.9-alpine" | |
- "python:3.10-alpine" | |
- "python:3.11-alpine" | |
steps: | |
- name: Install packages | |
# git needed for checkout | |
run: apk add git | |
- uses: actions/checkout@v2 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: pip install tox==4.6.3 tox-gh==1.2.0 | |
- name: Test with tox | |
run: python -m tox | |
publish: | |
if: (github.event_name == 'release' && github.event.action == 'created') || inputs.deploy | |
needs: [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/* |