Skip to content

CI

CI #481

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- 'master'
- 'maintenance/*'
tags:
- '[0-9].*'
schedule:
# Every Wednesday at 6:06 UTC
- cron: "6 6 * * 3"
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- uses: pre-commit/action@v3.0.0
test:
needs: pre-commit
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.10", "3.12"]
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: |
python -m pip install --upgrade pip
pip install tox
- run: tox -e py
coverage:
needs: test
runs-on: ubuntu-latest
if: ${{ !startsWith(github.ref, 'refs/tags') }}
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- run: |
python -m pip install --upgrade pip
pip install tox
- run: tox -e coverage
- uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
deploy:
needs: test
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.12"
- run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: softprops/action-gh-release@v1
with:
files: dist/*
generate_release_notes: true