-
Notifications
You must be signed in to change notification settings - Fork 14
185 lines (164 loc) · 4.99 KB
/
python.yml
File metadata and controls
185 lines (164 loc) · 4.99 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
name: Python
on: [pull_request, push]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build-wheel:
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- name: Windows x86_64
os: windows-2025
cmake-env:
- name: Windows aarch64
os: windows-11-arm
cmake-env:
- name: Linux x86_64
os: ubuntu-24.04
cmake-env:
- name: Linux aarch64
os: ubuntu-24.04-arm
cmake-env:
- name: macOS universal
os: macos-15
cmake-env: ARCHFLAGS="-arch arm64 -arch x86_64" MACOSX_DEPLOYMENT_TARGET=14.0
name: Build ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
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.10
# sccache doesn't work with MSBuild
if: runner.os != 'Windows'
- uses: actions/setup-python@v6
with:
# Minimum supported Python version
python-version: 3.12
- run: python3 ./tools/update_version.py
- run: pip3 install build
- run: ${{ matrix.cmake-env }} python3 -m build --wheel
- uses: actions/upload-artifact@v7
with:
name: ${{ matrix.name }} wheel
path: dist
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@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.version }}
- uses: actions/download-artifact@v7
with:
path: dist
pattern: '${{ matrix.name }} wheel'
- run: pip3 install pytest dist/sleipnirgroup_jormungandr-*.whl
shell: bash
- run: pytest
shell: bash
build-sdist:
name: sdist
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
# https://github.com/actions/checkout/issues/882
- run: git fetch --tags --force origin
- uses: actions/setup-python@v6
with:
python-version: 3.14
- run: python3 ./tools/update_version.py
- run: pip3 install build
- run: python3 -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