tox #498
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" | |
tags-ignore: | |
- "**" | |
pull_request: | |
schedule: | |
- cron: 1 0 * * * # Run daily at 0:01 UTC | |
jobs: | |
build: | |
name: ${{ matrix.tox_env }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- tox_env: lint | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Find python version | |
id: py_ver | |
shell: python | |
if: ${{ contains(matrix.tox_env, 'py') }} | |
run: | | |
v = '${{ matrix.tox_env }}'.split('-')[0].lstrip('py') | |
print('::set-output name=version::{0}.{1}'.format(v[0],v[1:])) | |
# Even our lint and other envs need access to tox | |
- name: Install a default Python | |
uses: actions/setup-python@v5 | |
if: ${{ ! contains(matrix.tox_env, 'py') }} | |
# Be sure to install the version of python needed by a specific test, if necessary | |
- name: Set up Python version | |
uses: actions/setup-python@v5 | |
if: ${{ contains(matrix.tox_env, 'py') }} | |
with: | |
python-version: ${{ steps.py_ver.outputs.version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip | |
pip install tox | |
- name: Run tox -e ${{ matrix.tox_env }} | |
run: | | |
echo "${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }}" | |
${{ matrix.PREFIX }} tox -e ${{ matrix.tox_env }} |