-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
217 lines (198 loc) · 6.96 KB
/
Copy pathci_workflows.yml
File metadata and controls
217 lines (198 loc) · 6.96 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
name: CI
on:
push:
branches:
- main
- 'v*'
tags:
- '*'
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ARCH_ON_CI: "normal"
IS_CRON: "false"
permissions:
contents: read
jobs:
initial_checks:
name: Mandatory checks before CI
runs-on: ubuntu-latest
steps:
- name: Check base branch
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
if: github.event_name == 'pull_request' && github.repository == 'astropy/astropy'
with:
script: |
const skip_label = 'skip-basebranch-check';
const { default_branch: allowed_basebranch } = context.payload.repository;
const pr = context.payload.pull_request;
if (pr.user.login === 'meeseeksmachine') {
core.info(`Base branch check is skipped since this is auto-backport by ${pr.user.login}`);
return;
}
if (pr.labels.find(lbl => lbl.name === skip_label)) {
core.info(`Base branch check is skipped due to the presence of ${skip_label} label`);
return;
}
if (pr.base.ref !== allowed_basebranch) {
core.setFailed(`PR opened against ${pr.base.ref}, not ${allowed_basebranch}`);
} else {
core.info(`PR opened correctly against ${allowed_basebranch}`);
}
lowest-tree-check:
name: Check environment lowest resolution against reference
needs: [initial_checks]
permissions:
contents: none
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
name: Install Python
with:
python-version: "3.14"
- run: pipx run scripts/check-lowest-resolved-tree.py
- if: failure()
run: pipx run scripts/check-lowest-resolved-tree.py --markdown --quiet >> "$GITHUB_STEP_SUMMARY" || true
tests:
needs: [initial_checks]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@e5af21e4ae37af089a73bb032e10b78b0e746174 # v3.0.1
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
setenv: |
ARCH_ON_CI: "normal"
IS_CRON: "false"
PY_COLORS: "1"
submodules: false
coverage: ''
libraries: |
apt:
- language-pack-fr
- tzdata
envs: |
# NOTE: this coverage test is needed for tests and code that
# run only with minimal dependencies.
- name: Python 3.12 with minimal dependencies and full coverage
linux: py312-test-cov
coverage: codecov
cache-path: .tox
cache-key: mindeps-${{ github.ref_name }}
- name: Python 3.13 in Parallel with all optional dependencies
linux: py313-test-alldeps-fitsio
libraries:
apt:
- language-pack-fr
- tzdata
- libbz2-dev
- libcfitsio-dev
toxargs: -v --develop
posargs: -n=4 --run-slow
cache-path: .tox
cache-key: alldeps-linux-${{ github.ref_name }}
- name: Python 3.11 with oldest supported version of all dependencies
linux: py311-test-oldestdeps-alldeps-cov-clocale
posargs: --remote-data=astropy
coverage: codecov
- name: Python 3.13 with all optional dependencies (Windows)
windows: py313-test-alldeps
posargs: --durations=50
cache-path: .tox
cache-key: alldeps-windows-${{ github.ref_name }}
- name: Python 3.13 with all optional dependencies (MacOS X)
macos: py313-test-alldeps
posargs: --durations=50 --run-slow
runs-on: macos-latest
cache-path: .tox
cache-key: alldeps-macos-${{ github.ref_name }}
- name: Python 3.13 aarch64, Run tests twice
linux: py313-test-double
runs-on: ubuntu-24.04-arm
posargs: -n=4
setenv: |
ARCH_ON_CI: "arm64"
IS_CRON: "false"
cache-path: .tox
cache-key: doubletest-${{ github.ref_name }}
allowed_failures:
needs: [initial_checks]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@e5af21e4ae37af089a73bb032e10b78b0e746174 # v3.0.1
with:
setenv: |
ARCH_ON_CI: "normal"
IS_CRON: "false"
PY_COLORS: "1"
submodules: false
coverage: ''
libraries: |
apt:
- language-pack-de
- tzdata
envs: |
- name: (Allowed Failure) Python 3.14 with remote data and dev version of key dependencies
linux: py314-test-devdeps
posargs: --remote-data=any --verbose
stub_tests:
needs: [initial_checks]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@e5af21e4ae37af089a73bb032e10b78b0e746174 # v3.0.1
with:
setenv: |
ARCH_ON_CI: "normal"
IS_CRON: "false"
submodules: false
envs: |
- name: Stubs for unit definition modules
linux: stubtest
cache-path: .tox
cache-key: stub_tests-${{ github.ref_name }}
test_wheel_building:
needs:
- initial_checks
- lowest-tree-check
# This ensures that a couple of wheel targets work fine in pull requests and pushes
permissions:
contents: none
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@e5af21e4ae37af089a73bb032e10b78b0e746174 # v3.0.1
with:
upload_to_pypi: false
upload_to_anaconda: false
test_extras: test
test_command: pytest -Wdefault --astropy-header -m "not hypothesis" -k "not test_data_out_of_range and not test_set_locale and not TestQuantityTyping" --strict-markers --pyargs astropy
targets: |
- cp311-manylinux_x86_64
test_limited_api_build:
# Test to make sure that we can build astropy with the limited API
# This job is also important to check `build` as our build frontend
# see https://github.com/astropy/astropy/pull/18253
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
name: Python 3.11 (build only, partial) with limited API (${{ matrix.os }})
needs:
- initial_checks
- lowest-tree-check
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
fetch-depth: 0
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
name: Install Python
with:
python-version: "3.11"
- run: |
python -m pip install build
python -m build
name: Run build
env:
EXTENSION_HELPERS_PY_LIMITED_API: 'cp311'