-
Notifications
You must be signed in to change notification settings - Fork 92
161 lines (144 loc) · 4.38 KB
/
tests.yml
File metadata and controls
161 lines (144 loc) · 4.38 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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: Tests
on:
push:
branches: ["main"]
pull_request:
schedule:
- cron: "0 0 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
name: Build and Inspect Package
runs-on: ubuntu-latest
outputs:
supported_python_classifiers_json_array: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: hynek/build-and-inspect-python-package@d44ca7d91762de7a7d5436ddae667c6da6d1c3df # v2.18.0
id: baipp
test:
name: Test (Python ${{ matrix.python-version }})
# Delay the test builds so the cover builds get a chance to start first.
needs: [build]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(needs.build.outputs.supported_python_classifiers_json_array) }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: calysto/maintainer_tools/actions/base-setup@v1
with:
python-version: ${{ matrix.python-version }}
- run: just test -v
test_sdist:
name: Test SDist
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: calysto/maintainer_tools/actions/base-setup@v1
- uses: calysto/maintainer_tools/actions/test-sdist@v1
cover:
name: Cover (${{ matrix.os }}, Python 3.10)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
env:
OS: ${{ matrix.os }}
PYTHON: "3.10"
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: calysto/maintainer_tools/actions/base-setup@v1
- name: Install graphviz
if: runner.os == 'Linux'
uses: tecolicom/actions-use-apt-tools@065d3fb036b7fc85487573596f97732ed0d3fce1 # v1.7
with:
tools: graphviz
- run: just cover -v
- name: Upload coverage to Codecov
if: github.event_name != 'pull_request' || !github.event.pull_request.head.repo.fork
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: OS,PYTHON
fail_ci_if_error: false
static:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: calysto/maintainer_tools/actions/base-setup@v1
- uses: calysto/maintainer_tools/actions/pre-commit-run@v1
- run: just docs
- run: just help
- name: Test typing
run: just typing
test_minimum_versions:
name: Test Minimum Versions
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: calysto/maintainer_tools/actions/base-setup@v1
- uses: calysto/maintainer_tools/actions/test-minimum-versions@v1
run_notebooks:
name: Run Notebooks
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: calysto/maintainer_tools/actions/base-setup@v1
- run: just run-notebooks
test_release:
name: Test Release (Dry Run)
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: calysto/maintainer_tools/actions/base-setup@v1
- uses: calysto/maintainer_tools/actions/release@v1
with:
version: patch
dry_run: "true"
ref: ${{ github.head_ref }}
tests_check: # This job does nothing and is only used for the branch protection
if: always()
needs:
- build
- test
- test_sdist
- cover
- static
- test_minimum_versions
- run_notebooks
- test_release
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
with:
jobs: ${{ toJSON(needs) }}