tox #610
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: | |
create: # is used for publishing to PyPI and 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 * * * # Run daily at 0:01 UTC | |
# Run every Friday at 18:02 UTC | |
# https://crontab.guru/#2_18_*_*_5 | |
# - cron: 2 18 * * 5 | |
workflow_call: | |
jobs: | |
tox: | |
name: >- | |
${{ matrix.env.TOXENV }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- 3.9 | |
os: | |
- ubuntu-20.04 | |
env: | |
- TOXENV: lint | |
- TOXENV: packaging | |
- TOXENV: py | |
env: | |
TOX_PARALLEL_NO_SPINNER: 1 | |
FORCE_COLOR: 1 | |
steps: | |
- name: Check out src from Git | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # needed by setuptools-scm | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Pre-commit cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pre-commit | |
key: ${{ runner.os }}-${{ matrix.env.TOXENV }}-pre-commit-${{ hashFiles('setup.cfg', 'tox.ini', 'pyproject.toml', '.pre-commit-config.yaml') }} | |
- name: Pip cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-${{ matrix.env.TOXENV }}-pip-${{ hashFiles('setup.cfg', 'tox.ini', 'pyproject.toml', '.pre-commit-config.yaml') }} | |
- name: Install tox | |
run: | | |
python3 -m pip install --upgrade tox | |
- name: Log installed dists | |
run: >- | |
python -m pip freeze --all | |
- name: >- | |
Initialize tox envs | |
run: >- | |
python -m | |
tox | |
--parallel auto | |
--parallel-live | |
--notest | |
--skip-missing-interpreters false | |
-vv | |
env: ${{ matrix.env }} | |
- name: Test with tox | |
run: | | |
python -m tox --parallel auto --parallel-live | |
env: ${{ matrix.env }} |