-
Notifications
You must be signed in to change notification settings - Fork 1
executable file
·116 lines (114 loc) · 2.78 KB
/
ci.yml
File metadata and controls
executable file
·116 lines (114 loc) · 2.78 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CI
on:
push:
branches:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
python: "3.12"
- name: Run linters
# Temporarily disabled so I get CI up and running and I can fix the new
# lint errors separately.
run: |
nox -ts --python=3.12 --tags lint
check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10"]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
python: ${{ matrix.python }}
- name: Run typechecking
if: ${{ !startsWith(matrix.python, 'pypy') }}
run: |
nox -ts --python=${{ matrix.python }} -e mypy
- name: Run tests
run: |
nox -ts --python=${{ matrix.python }} -e test
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.python }}
path: |
coverage.test-${{ matrix.python }}
junit.test-${{ matrix.python }}.xml
coverage:
runs-on: ubuntu-latest
needs:
- check
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
python: "3.12"
- uses: actions/download-artifact@v4
with:
pattern: test-results-*
path: .
- name: Move files
run: mv test-results*/coverage.* .
- name: Generate coverage report
run: |
nox -ts --python=3.12 -e coverage
- name: Upload coverage results
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage
path: |
htmlcov
coverage.xml
docs:
runs-on: ubuntu-latest
needs:
- lint
- check
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
python: "3.12"
- name: Build docs
run: |
nox -ts -e docs
- name: Upload docs
uses: actions/upload-artifact@v4
with:
name: docs
path: |
docs/build
package:
runs-on: ubuntu-latest
needs:
- lint
- check
- docs
- coverage
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
python: "3.12"
- uses: actions/download-artifact@v4
with:
pattern: docs
path: docs/build
- name: Build package
run: |
nox -ts -e build
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: dist
path: |
dist