-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (63 loc) · 1.76 KB
/
test.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
name: test
on: [ push ]
concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true
env:
PYTHONUNBUFFERED: "1"
FORCE_COLOR: "1"
jobs:
static_tests:
name: Static Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install latest pip and Hatch
run: pip install --upgrade pip hatch
- name: Lint
run: hatch run lint:all
- name: Docs
run: hatch run docs:build
- name: Build
run: hatch build
tests_matrix:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install latest pip, Hatch and coveralls
run: pip install --upgrade pip hatch coveralls
- name: Run tests
run: hatch run test-cov
- name: Coverage combine
run: coverage combine
- name: Upload coveralls (parallel)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
run: coveralls --service=github
tests:
if: always()
runs-on: ubuntu-latest
needs: [static_tests, tests_matrix]
steps:
- name: Check tests matrix status
if: needs.tests_matrix.result != 'success'
run: exit 1
- name: Finish parallel build
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
github-token: ${{ secrets.GITHUB_TOKEN }}