forked from astropy/astropy
-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (100 loc) · 3.29 KB
/
ci_workflows.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
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
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"
jobs:
initial_checks:
name: Mandatory checks before CI
runs-on: ubuntu-latest
steps:
- name: Check base branch
uses: actions/github-script@v7
if: github.event_name == 'pull_request'
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}`);
}
tests:
needs: [initial_checks]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
setenv: |
ARCH_ON_CI: "normal"
IS_CRON: "false"
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
- name: Python 3.11 in Parallel with all optional dependencies
linux: py311-test-alldeps-fitsio
libraries:
apt:
- language-pack-fr
- tzdata
- libcfitsio-dev
toxargs: -v --develop
posargs: -n=4 --run-slow
- name: Python 3.10 with oldest supported version of all dependencies
linux: py310-test-oldestdeps-alldeps-cov-clocale
posargs: --remote-data=astropy
coverage: codecov
- name: Python 3.11 with all optional dependencies (Windows)
windows: py311-test-alldeps
posargs: --durations=50
- name: Python 3.11 with all optional dependencies (MacOS X)
macos: py311-test-alldeps
posargs: --durations=50 --run-slow
- name: Python 3.10 Double test (Run tests twice)
linux: py310-test-double
allowed_failures:
needs: [initial_checks]
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
with:
setenv: |
ARCH_ON_CI: "normal"
IS_CRON: "false"
submodules: false
coverage: ''
libraries: |
apt:
- language-pack-de
- tzdata
envs: |
- name: (Allowed Failure) Python 3.12 with remote data and dev version of key dependencies
linux: py312-test-devdeps
posargs: --remote-data=any --verbose