-
Notifications
You must be signed in to change notification settings - Fork 15
212 lines (186 loc) · 5.98 KB
/
Copy pathpython.yml
File metadata and controls
212 lines (186 loc) · 5.98 KB
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
name: Python
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-wheel:
env:
ARCHFLAGS: -arch arm64 -arch x86_64
MACOSX_DEPLOYMENT_TARGET: 14.0
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- name: Windows x86_64
os: windows-2025
- name: Windows aarch64
os: windows-11-arm
- name: Linux x86_64
os: ubuntu-24.04
- name: Linux aarch64
os: ubuntu-24.04-arm
- name: macOS universal
os: macos-15
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
# https://github.com/actions/checkout/issues/882
- run: git fetch --tags --force origin
- name: Make GCC 14 the default toolchain (Linux)
if: runner.os == 'Linux'
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 200
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 200
- name: Set up sccache
uses: mozilla-actions/sccache-action@v0.0.11
# sccache doesn't work with MSBuild
if: runner.os != 'Windows'
- uses: actions/setup-python@v7
with:
# Minimum supported Python version
python-version: 3.12
- run: python ./tools/update_version.py
if: ${{ !(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }}
- run: python ./tools/update_version.py --release
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
- name: Build wheel
run: |
pip install build
python .github/workflows/print_constraints.py > constraints.txt
python -m build --wheel --dependency-constraints-txt constraints.txt
- name: Repair wheel (Windows)
run: |
pip install delvewheel
python -m delvewheel repair -v dist/*.whl
if: runner.os == 'Windows'
- name: Repair wheel (Linux)
run: |
pip install auditwheel
python -m auditwheel repair dist/*.whl
if: runner.os == 'Linux'
- name: Repair wheel (macOS)
run: |
pip install delocate
delocate-wheel -w wheelhouse -v dist/*.whl
if: runner.os == 'macOS'
- uses: actions/upload-artifact@v7
with:
name: ${{ matrix.name }} wheel
path: wheelhouse
test-wheel:
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
include:
- name: Windows x86_64
os: windows-2025
version: "3.12"
- name: Windows aarch64
os: windows-11-arm
version: "3.12"
- name: Linux x86_64
os: ubuntu-24.04
version: "3.12"
- name: Linux aarch64
os: ubuntu-24.04-arm
version: "3.12"
- name: macOS universal
os: macos-15
version: "3.12"
- name: Windows x86_64
os: windows-2025
version: "3.13"
- name: Windows aarch64
os: windows-11-arm
version: "3.13"
- name: Linux x86_64
os: ubuntu-24.04
version: "3.13"
- name: Linux aarch64
os: ubuntu-24.04-arm
version: "3.13"
- name: macOS universal
os: macos-15
version: "3.13"
- name: Windows x86_64
os: windows-2025
version: "3.14"
- name: Windows aarch64
os: windows-11-arm
version: "3.14"
- name: Linux x86_64
os: ubuntu-24.04
version: "3.14"
- name: Linux aarch64
os: ubuntu-24.04-arm
version: "3.14"
- name: macOS universal
os: macos-15
version: "3.14"
name: Test ${{ matrix.name }} (${{ matrix.version }})
runs-on: ${{ matrix.os }}
needs: [build-wheel]
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.version }}
- uses: actions/download-artifact@v8
with:
path: dist
pattern: '${{ matrix.name }} wheel'
- run: pip install pytest dist/sleipnirgroup_jormungandr-*.whl
shell: bash
- run: pytest
shell: bash
build-sdist:
name: sdist
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
# https://github.com/actions/checkout/issues/882
- run: git fetch --tags --force origin
- uses: actions/setup-python@v7
with:
python-version: 3.14
- run: python ./tools/update_version.py
if: ${{ !(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }}
- run: python ./tools/update_version.py --release
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
- run: pip install build
- run: python -m build --sdist
- uses: actions/upload-artifact@v7
with:
name: sdist
path: dist
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-24.04
needs: [test-wheel, build-sdist]
if: github.repository_owner == 'SleipnirGroup' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
environment:
name: pypi
url: https://pypi.org/p/sleipnirgroup-jormungandr
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
path: dist
pattern: '* wheel'
merge-multiple: true
- uses: actions/download-artifact@v8
with:
path: dist
pattern: 'sdist'
merge-multiple: true
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1