Skip to content

tox

tox #1463

Workflow file for this run

name: tox
on:
create: # is used for publishing to TestPyPI
tags: # any tag regardless of its name, no branches
- "**"
push: # only publishes pushes to the main branch to TestPyPI
branches: # any integration branch but not tag
- "main"
pull_request:
release:
types:
- published # It seems that you can publish directly without creating
schedule:
- cron: 1 0 15 * * # Run each month on day 15 at 0:01 UTC
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tox -e lint
run: |
tox -e lint
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toxenv: [docs, packaging, py39]
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Run tox -e ${{ matrix.toxenv }}
run: |
tox -e ${{ matrix.toxenv }}
check: # This job does nothing and is only used for the branch protection
if: always()
permissions:
pull-requests: write # allow codenotify to comment on pull-request
needs:
- lint
- build
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}