-
Notifications
You must be signed in to change notification settings - Fork 8
69 lines (59 loc) · 1.92 KB
/
run-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
name: Tests
on:
push:
branches:
- main
- master
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install dependencies
run: pip install nox
- name: Run tests
run: nox -s test-${{ matrix.python-version }}
- name: "Upload artifact"
uses: "actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808"
with:
name: coverage-data-${{ matrix.python-version }}
path: ".coverage.*"
if-no-files-found: error
coverage:
if: always()
runs-on: "ubuntu-latest"
needs: tests
steps:
- name: "Checkout repository"
uses: "actions/checkout@d632683dd7b4114ad314bca15554477dd762a938"
- name: "Setup Python"
uses: "actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b"
with:
python-version: "3.x"
- name: "Install coverage"
run: "python -m pip install --upgrade coverage"
- name: "Download artifact"
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
pattern: coverage-data*
merge-multiple: true
- name: "Combine & check coverage"
run: |
python -m coverage combine
python -m coverage html --skip-covered --skip-empty
python -m coverage report --ignore-errors --show-missing --fail-under=77
- name: "Upload report"
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808
with:
name: coverage-report
path: htmlcov