-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (70 loc) · 2.23 KB
/
ci_tests.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
name: CI
on:
push:
branches:
- main
- 'v*'
tags:
- '*'
pull_request:
permissions:
contents: read
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:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
needs: initial_checks
with:
envs: |
# Standard tests
- linux: py310-test-cov
- linux: py312-test-cov
# All deps tests
- linux: py311-test-alldeps
toxargs: '-v --develop'
- linux: py39-test-oldestdeps-alldeps-cov-clocale
# Platform test
- windows: py311-test-alldeps
# - macos: py311-test-alldeps # TODO: https://github.com/OpenAstronomy/github-actions-workflows/issues/197
conda: true
coverage: codecov
fail-fast: true
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
wheels_tests:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
needs: initial_checks
permissions:
contents: none
with:
upload_to_pypi: false
upload_to_anaconda: false
test_extras: test
test_command: pytest $GITHUB_WORKSPACE/tests $GITHUB_WORKSPACE/docs -p no:warnings