Skip to content

[pre-commit.ci] pre-commit autoupdate #125

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #125

Workflow file for this run

name: build
on:
push:
branches: [ main ]
tags: ['*']
pull_request:
branches: [ main ]
release:
types:
- published
env:
PYTEST_ADDOPTS: "--color=yes"
jobs:
tests:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Verify Python environment
run: |
pip list
pip cache list
pip check
- name: Install dependencies
run: python -m pip install --upgrade pip nox
- name: Run tests
run: nox --session tests-cov -- -v
deploy:
needs: [tests]
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install dependencies
run: python -m pip install --upgrade pip nox
- name: Package
run: nox --session release-build
- name: Publish package
if: |
(
( github.event_name == 'release' && github.event.action == 'published' ) ||
( github.event_name == 'push' && startsWith(github.ref, 'refs/tags') )
)
env:
TEST_PYPI_TOKEN: ${{ secrets.TEST_PYPI_TOKEN }}
run: nox --session release-upload -- --repository testpypi