-
Notifications
You must be signed in to change notification settings - Fork 50
134 lines (129 loc) · 3.73 KB
/
ci.yaml
File metadata and controls
134 lines (129 loc) · 3.73 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: CI
on:
push:
branches: [main, 3.x.x]
paths:
- "**.py"
- "**.toml"
- "**.lock"
pull_request:
branches: [main, 3.x.x]
types: [opened, synchronize]
paths:
- ".github/workflows/ci.yaml" # self
- "**.py"
- "**.toml"
- "**.lock"
- ".pre-commit-config.yaml"
jobs:
Tests:
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
python-version: "3.10"
- os: ubuntu-latest
python-version: "3.11"
- os: ubuntu-latest
python-version: "3.12"
- os: ubuntu-latest
python-version: "3.13"
- os: windows-latest
python-version: "3.10"
- os: macos-latest
python-version: "3.10"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python-uv
with:
python-version: ${{ matrix.python-version }}
- run: tox run -e py
- name: Upload coverage results
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest' # Cross-platform coverage combination doesn't work
with:
name: coverage-results-${{ matrix.python-version }}
path: .coverage*
include-hidden-files: true
Tutorial-tests:
runs-on: ubuntu-latest
name: Tutorial tests
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install cadwyn with instructions from docs
run: sh docs_src/quickstart/setup/block001.sh
- run: |
pip install uv
uv pip install --system pytest coverage dirty-equals
coverage run -m pytest docs_src
- name: Upload coverage results
uses: actions/upload-artifact@v4
with:
name: coverage-results-docs
path: .coverage*
include-hidden-files: true
Coverage:
needs: [Tests, Tutorial-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download coverage info
uses: actions/download-artifact@v4
with:
pattern: coverage-results-*
merge-multiple: true
path: .
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: |
pip install uv
uv pip install --system tox tox-uv
tox run -e coverage_report
- name: Upload to Codecov
uses: codecov/codecov-action@v5
env:
fail_ci_if_error: true
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: |
python -m pip install uv
uv pip install --system pre-commit pre-commit-uv
pre-commit run --all-files
Validate-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python-uv
with:
# When this version is updated,
# update the pyright `base_python` version in `tox.ini`, too.
python-version: "3.10"
- run: tox run -e docs
- name: Validate links
uses: umbrelladocs/action-linkspector@v1
with:
reporter: github-pr-review
filter_mode: diff_context
fail_level: any
Typecheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-python-uv
with:
# When this version is updated,
# update the pyright `base_python` version in `tox.ini`, too.
python-version: "3.10"
- run: tox run -e pyright