Update and clean up test environments #489
Workflow file for this run
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
# GitHub Actions workflow for testing and continuous integration. | |
# | |
# This file performs testing using tox and tox.ini to define and configure the test environments. | |
name: Python Tests | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '*' | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
TOXARGS: '-v' | |
jobs: | |
# Set up matrix to run tox tests across lists of os, python version, and tox environment | |
matrix_tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# Github actions supports ubuntu, windows, and macos virtual environments: | |
# https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners | |
# | |
# Only run on ubuntu by default, but can add other os's to the test matrix here. | |
# For example -- os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
python: '3.8' | |
tox_env: 'py38-test' | |
- os: ubuntu-latest | |
python: '3.9' | |
tox_env: 'py39-test' | |
- os: ubuntu-latest | |
python: '3.10' | |
tox_env: 'py310-test-cov' | |
- os: ubuntu-latest | |
python: '3.11' | |
tox_env: 'py311-test' | |
- os: ubuntu-latest | |
python: '3.12' | |
tox_env: 'py312-test' | |
- os: macos-latest | |
python: '3.12' | |
tox_env: 'py312-test-devdeps' | |
- os: ubuntu-latest | |
python: '3.12' | |
tox_env: 'codestyle' | |
- os: ubuntu-latest | |
python: '3.8' | |
tox_env: 'py38-test-oldestdeps' | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up python ${{ matrix.python }} with tox environment ${{ matrix.tox_env }} on ${{ matrix.os }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install base dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install tox | |
- name: Test with tox | |
run: | | |
tox -e ${{ matrix.tox_env }} | |
- name: Upload coverage to codecov | |
if: "contains(matrix.tox_env, '-cov')" | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
verbose: true |