-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (45 loc) · 1.33 KB
/
test.yaml
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
name: Tests
on: pull_request
jobs:
ruff:
name: Ruff Check & Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Ruff
run: pip3 install ruff==0.6.7 # Must match version pinned in .pre-commit.yaml
- run: ruff check
- run: ruff format --check
typecheck:
name: MyPy Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: citizensadvice/python-poetry-setup-action@v1
with:
python_version: 3.12
- name: Run type check
run: poetry run mypy .
pytest:
name: Testing on python ${{ matrix.python_version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- uses: citizensadvice/python-poetry-setup-action@v1
with:
python_version: ${{ matrix.python_version }}
- name: Run tests
run: poetry run pytest -vv
test:
# Single job for github to expect. Any merge-blocking checks should be added to the needs array
name: Gather Results
if: always()
runs-on: ubuntu-latest
needs: [ruff, pytest, typecheck]
steps:
- run: exit 1
if: ${{contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')}}