-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (111 loc) · 3.8 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
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
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:
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: |
- name: Python 3.10 with minimal dependencies and full coverage
linux: py310-test-cov
coverage: codecov
- name: Python 3.11 with minimal dependencies and full coverage
linux: py311-test-cov
coverage: codecov
- name: Python 3.11 with all optional dependencies
linux: py311-test-alldeps
libraries:
apt:
- language-pack-fr
- tzdata
toxargs: -v --develop
- name: Python 3.8 with oldest supported version of all dependencies
linux: py38-test-oldestdeps-alldeps-cov
coverage: codecov
- name: Python 3.10 with all optional dependencies (Windows)
windows: py310-test-alldeps
posargs: --durations=50
- name: Python 3.10 with all optional dependencies (MacOS X)
macos: py310-test-alldeps
posargs: --durations=50
test_pure_wheel_building:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
if: (github.event_name == 'push' || github.event_name == 'pull_request')
needs: initial_checks
with:
upload_to_pypi: false
repository_url: https://test.pypi.org/legacy/
upload_to_anaconda: false
test_extras: test
test_command: pytest $GITHUB_WORKSPACE/tests $GITHUB_WORKSPACE/docs
secrets:
pypi_token: ${{ secrets.TEST_PYPI_API_TOKEN }}
# FIXME! use OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1
test_wheel_building:
# This ensures that a couple of targets work fine in pull requests and pushes
name: mypyc wheels (${{ matrix.name }})
if: (github.event_name == 'push' || github.event_name == 'pull_request')
needs: initial_checks
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
include:
- os: ubuntu-latest
name: linux-x86_64
steps:
- uses: actions/checkout@v3
- name: Build wheels via cibuildwheel
uses: pypa/[email protected]
env:
CIBW_ARCHS_MACOS: "${{ matrix.macos_arch }}"
# This isn't supported in pyproject.toml which makes sense (but is annoying).
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
- name: Upload wheels as workflow artifacts
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.name }}-mypyc-wheels
path: ./wheelhouse/*.whl