-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (50 loc) · 1.47 KB
/
ci.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
name: CI
on:
push:
branches:
- main
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@v3
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.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
with:
envs: |
- linux: py311-test-cov
- linux: py310-test-alldeps
toxargs: '-v --develop'
- linux: py39-test-oldestdeps-alldeps-cov
# - windows: py310-test-alldeps
# - macos: py310-test-alldeps
conda: true
coverage: codecov
fail-fast: false
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}