-
-
Notifications
You must be signed in to change notification settings - Fork 0
180 lines (168 loc) · 5.62 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
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
# This file is autogenerated by maturin v1.4.0
# To update, run
#
# maturin generate-ci --pytest github
#
name: CI
on:
push:
branches: [ "main" ]
release:
types: [ published ]
pull_request:
types: [ opened, reopened, synchronize ]
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
rust:
runs-on: ubuntu-24.04
strategy:
matrix:
toolchain:
- stable
- beta
- nightly
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Update Rust toolchain
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
linux:
runs-on: ubuntu-22.04
strategy:
matrix:
target: [x86_64, aarch64, armv7, s390x, ppc64le]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@60d11847b29f81ca5375519a8eb33cc336ba4bfa # v1.41.0
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
container: ghcr.io/rust-cross/manylinux_2_28-cross:${{ matrix.target }}
sccache: 'true'
manylinux: '2_28'
- name: Upload wheels
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: wheels-linux-${{ matrix.target }}
path: dist
- name: pytest
if: ${{ startsWith(matrix.target, 'x86_64') }}
shell: bash
run: |
set -e
pip install cog3pio[tests] --find-links dist --force-reinstall
pytest --verbose
- name: pytest
if: ${{ !startsWith(matrix.target, 'x86') && matrix.target != 'ppc64' }}
uses: uraimo/run-on-arch-action@5397f9e30a9b62422f302092631c99ae1effcd9e # v2.8.1
with:
arch: ${{ matrix.target }}
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt update
apt install -y --no-install-recommends \
gcc g++ gfortran libopenblas-dev liblapack-dev ninja-build \
pkg-config python3-pip python3-dev
pip3 install -U pip pytest
run: |
set -e
pip3 install cog3pio --find-links dist --force-reinstall
pytest --verbose
windows:
runs-on: windows-2022
strategy:
matrix:
target: [x64]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.10'
architecture: ${{ matrix.target }}
- name: Build wheels
uses: PyO3/maturin-action@60d11847b29f81ca5375519a8eb33cc336ba4bfa # v1.41.0
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: wheels-windows-${{ matrix.target }}
path: dist
- name: pytest
shell: bash
run: |
set -e
pip install cog3pio[tests] --find-links dist --force-reinstall
pytest --verbose
macos:
runs-on: macos-14
strategy:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: '3.10'
- name: Build wheels
uses: PyO3/maturin-action@60d11847b29f81ca5375519a8eb33cc336ba4bfa # v1.41.0
with:
target: ${{ matrix.target }}
args: --release --out dist --find-interpreter
sccache: 'true'
- name: Upload wheels
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: wheels-macos-${{ matrix.target }}
path: dist
- name: pytest
if: ${{ startsWith(matrix.target, 'aarch64') }}
shell: bash
run: |
set -e
pip install cog3pio[tests] --find-links dist --force-reinstall
pytest --verbose
sdist:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Build sdist
uses: PyO3/maturin-action@60d11847b29f81ca5375519a8eb33cc336ba4bfa # v1.41.0
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: wheels-sdist
path: dist
release:
name: Release
runs-on: ubuntu-22.04
if: "startsWith(github.ref, 'refs/tags/')"
needs: [linux, windows, macos, sdist]
steps:
- name: Download built wheels
uses: actions/download-artifact@eaceaf801fd36c7dee90939fad912460b18a1ffe # v4.1.2
- name: Publish to PyPI
uses: PyO3/maturin-action@60d11847b29f81ca5375519a8eb33cc336ba4bfa # v1.41.0
env:
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
with:
command: upload
args: --non-interactive --skip-existing wheels-*/*