-
Notifications
You must be signed in to change notification settings - Fork 8
94 lines (86 loc) · 2.54 KB
/
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Tests
on:
- push
- pull_request
jobs:
test:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- name: Test suite with py39-ubuntu
python: "3.9"
os: ubuntu-latest
toxenv: py39
experimental: false
- name: Test suite with py310-ubuntu
python: "3.10"
os: ubuntu-latest
toxenv: py310
experimental: false
- name: Test suite with py311-ubuntu
python: "3.11"
os: ubuntu-latest
toxenv: py311
experimental: false
- name: Test suite with py312-ubuntu
python: "3.12"
os: ubuntu-latest
toxenv: py312
experimental: false
- name: Type check with mypy
python: "3.9"
os: ubuntu-latest
toxenv: type
experimental: false
- name: Formatting with black + isort
python: "3.9"
os: ubuntu-latest
toxenv: format
experimental: false
- name: Linting with flake8 + ruff
python: "3.9"
os: ubuntu-latest
toxenv: lint
experimental: false
- name: Codacy Coverage Report
python: "3.9"
os: ubuntu-latest
toxenv: coverage
experimental: false
name: ${{ matrix.name }}
env:
# Color Output
# Rich (pip)
FORCE_COLOR: 1
# Tox
PY_COLORS: 1
# MyPy
TERM: xterm-color
MYPY_FORCE_COLOR: 1
MYPY_FORCE_TERMINAL_WIDTH: 200
# Pytest
PYTEST_ADDOPTS: "--color=yes"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
check-latest: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Setup tox environment
run: tox -e ${{ matrix.toxenv }} --notest
- name: Test
run: tox -e ${{ matrix.toxenv }} --skip-pkg-install
- name: Run codacy-coverage-reporter
if: ${{ matrix.toxenv == 'coverage' && github.repository == 'martinvonk/spei' && success() }}
uses: codacy/codacy-coverage-reporter-action@master
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml