-
Notifications
You must be signed in to change notification settings - Fork 24
167 lines (151 loc) · 4.94 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
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
name: CI
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
name: ${{ matrix.name }} [ ${{ matrix.os }} ]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: [3.9]
toxenv: [test]
toxargs: [-v]
include:
- name: Test with oldest supported versions of our dependencies
os: ubuntu-20.04
python: 3.9
toxenv: test-oldestdeps
toxargs: -v
- name: Test with medium old supported versions of our dependencies
# Test that we do not have a problem with some specific version (gh-101).
# Comment out if not needed.
os: ubuntu-22.04
python: 3.9
toxenv: test-olddeps
toxargs: -v
- name: Test with development versions of our dependencies
os: ubuntu-latest
python: '3.12-dev'
toxenv: test-devdeps
toxargs: -v
- name: Code style checks
os: ubuntu-latest
python: 3.x
toxenv: codestyle
toxargs: -v
- name: Documentation build
os: ubuntu-latest
python: 3.x
toxenv: build_docs
toxargs: -v
apt_packages: graphviz
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install APT packages
if: matrix.apt_packages
run: sudo apt-get install ${{ matrix.apt_packages }}
- name: Install packages for macOS
if: matrix.os == 'macos-latest'
run: brew install autoconf automake
- name: Install Python dependencies
run: python -m pip install --upgrade tox
- name: Run tests
run: |
pip freeze
tox ${{ matrix.toxargs }} -e ${{ matrix.toxenv }} -- ${{ matrix.toxposargs }}
tests_external_liberfa:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
PYERFA_USE_SYSTEM_LIBERFA: 1
strategy:
fail-fast: true
matrix:
include:
- name: Tests with external liberfa
os: ubuntu-latest
python: 3.9
toxenv: test
toxargs: -v
apt_packages: python3-venv python3-pip liberfa-dev python3-numpy
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install APT packages
if: matrix.apt_packages
run: sudo apt-get install ${{ matrix.apt_packages }}
- name: Run tests
run: |
python -m venv --system-site-packages tests
source tests/bin/activate
python -m pip install --editable .[test]
(nm -u erfa/ufunc.cpython-*.so | grep eraA2af) || exit 1
(python -c 'import erfa' 2>&1 | grep -n 'too old') > /dev/null && (echo 'liberfa too old, skipping tests'; exit 0) || python -m pytest
build_and_publish:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish.yml@v1
with:
upload_to_pypi: ${{ startsWith(github.ref, 'refs/tags/v') && !endsWith(github.ref, '.dev') }}
test_extras: test
test_command: pytest --pyargs erfa
targets: |
# Linux wheels
- cp39-manylinux_x86_64
- cp310-manylinux_x86_64
- cp311-manylinux_x86_64
- cp312-manylinux_x86_64
- cp39-musllinux_x86_64
- cp310-musllinux_x86_64
- cp311-musllinux_x86_64
- cp312-musllinux_x86_64
- cp39-manylinux_aarch64
- cp310-manylinux_aarch64
- cp311-manylinux_aarch64
- cp312-manylinux_aarch64
# MacOS X wheels - we deliberately do not build universal2 wheels.
# Note that the arm64 wheels are not actually tested so we
# rely on local manual testing of these to make sure they are ok.
- cp39*macosx_x86_64
- cp310*macosx_x86_64
- cp311*macosx_x86_64
- cp312*macosx_x86_64
- cp39*macosx_arm64
- cp310*macosx_arm64
- cp311*macosx_arm64
- cp312*macosx_arm64
# Windows wheels
- cp39*win32
- cp310*win32
- cp311*win32
# TODO: Check again after cp312 and upstream are stable.
#- cp312*win32
- cp39*win_amd64
- cp310*win_amd64
- cp311*win_amd64
- cp312*win_amd64
# Required so that cp312 can grab a pre-release numpy.
# Can remove when cp312 is released.
env: |
CIBW_ENVIRONMENT: 'PIP_PRE=$( if [ "${CIBW_BUILD:0:5}" = "cp312" ]; then echo 1; else echo 0; fi )'
secrets:
pypi_token: ${{ secrets.pypi_token }}