-
-
Notifications
You must be signed in to change notification settings - Fork 38
74 lines (68 loc) · 2.15 KB
/
tox-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# 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.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.10'
tox_env: 'py310-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@v4
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