-
Notifications
You must be signed in to change notification settings - Fork 42
80 lines (74 loc) · 2.17 KB
/
Copy pathtest.yml
File metadata and controls
80 lines (74 loc) · 2.17 KB
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
name: Test & Lint
on:
push:
branches:
- main
pull_request:
workflow_call: # Allow for the publish workflows to run the tests by calling this workflow
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: 3.13
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install .[test]
- name: Run linting
run: |
make format
test:
name: Python ${{ matrix.python}} ${{ matrix.toxenv }}
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
experimental: [false]
toxenv: ["py"]
include:
# Future Wagtail release from main branch (allowed to fail)
- python: "3.13"
toxenv: wagtailmain
experimental: true
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install tox tox-py coverage
# This step runs only for jobs NOT in the include matrix
- name: Run tox targets for Python ${{ matrix.python }}
if: ${{ matrix.toxenv == 'py' }}
run: |
tox --py current
# This step runs only for jobs in the include matrix
- name: Run tox targets for Python ${{ matrix.python }} (${{ matrix.toxenv }})
if: ${{ matrix.toxenv != 'py' }}
run: |
tox -e ${{ matrix.toxenv }}
env:
TOXENV: ${{ matrix.toxenv }}
- name: Generate coverage report
run: |
coverage combine
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: unittests
fail_ci_if_error: true