tox #548
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: tox | |
on: | |
merge_group: | |
push: # only publishes pushes to the main branch to TestPyPI | |
branches: # any integration branch but not tag | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
schedule: | |
# Run every Friday at 18:02 UTC | |
# https://crontab.guru/#2_18_*_*_5 | |
- cron: 2 18 * * 5 | |
jobs: | |
tests: | |
name: ${{ matrix.tox-env }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- 3.9 | |
tox-env: | |
- lint | |
- docs | |
- docs-devel | |
- pkg | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
- name: Pre-commit cache | |
if: ${{ matrix.tox-env == 'lint' }} | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/pre-commit | |
key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} }} | |
- name: Install tox | |
run: python3 -m pip install --upgrade "tox>=4.0.0rc3" | |
- name: Test with tox | |
run: python3 -m tox -e ${{ matrix.tox-env }} | |
- name: Archive logs | |
uses: actions/upload-artifact@v3 | |
with: | |
name: logs.zip | |
path: .tox/**/log/ | |
check: # This job does nothing and is only used for the branch protection | |
if: always() | |
needs: | |
- tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Decide whether the needed jobs succeeded or failed | |
uses: re-actors/alls-green@release/v1 | |
with: | |
jobs: ${{ toJSON(needs) }} |