Skip to content

Commit 6b1a78a

Browse files
authored
0.0.8 (#24)
1 parent 9a660ac commit 6b1a78a

16 files changed

Lines changed: 166 additions & 268 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 37 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ concurrency:
2323

2424
jobs:
2525
cargo-fmt:
26-
name: "cargo fmt"
26+
name: "cargo fmt (nightly)"
2727
runs-on: ubuntu-latest
28-
timeout-minutes: 10
2928
steps:
3029
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
3130
with:
@@ -35,14 +34,15 @@ jobs:
3534
run: rustup toolchain install nightly --component rustfmt
3635

3736
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
37+
if: github.event_name == 'pull_request' && github.run_attempt == 1
3838
with:
39-
lookup-only: true
39+
lookup-only: false # zizmor: ignore[cache-poisoning]
40+
4041
- run: cargo fmt-nightly --check
4142

4243
cargo-clippy:
43-
name: "cargo clippy"
44+
name: "cargo clippy (nightly)"
4445
runs-on: ubuntu-latest
45-
timeout-minutes: 10
4646
steps:
4747
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4848
with:
@@ -52,59 +52,29 @@ jobs:
5252
run: rustup toolchain install nightly --component clippy
5353

5454
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
55+
if: github.event_name == 'pull_request' && github.run_attempt == 1
5556
with:
56-
lookup-only: true
57-
- run: cargo clippy --all-targets
58-
59-
zizmor:
60-
name: "zizmor"
61-
runs-on: ubuntu-latest
62-
steps:
63-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
64-
with:
65-
persist-credentials: false
66-
67-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
68-
with:
69-
python-version: "3.14"
70-
71-
- name: "Install uv"
72-
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
73-
with:
74-
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
57+
lookup-only: false # zizmor: ignore[cache-poisoning]
7558

76-
- name: "Install zizmor"
77-
run: uv pip install --group zizmor --system
78-
79-
- name: "Run zizmor"
80-
run: zizmor .github/
59+
- run: cargo clippy --all-targets
8160

82-
typos:
83-
name: "typos"
61+
tools:
8462
runs-on: ubuntu-latest
85-
steps:
86-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
87-
with:
88-
persist-credentials: false
8963

90-
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
91-
with:
92-
python-version: "3.14"
64+
strategy:
65+
matrix:
66+
include:
67+
- name: "zizmor"
68+
command: zizmor .github/
9369

94-
- name: "Install uv"
95-
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
96-
with:
97-
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
70+
- name: "typos"
71+
command: typos --config .typos.toml
9872

99-
- name: "Install typos"
100-
run: uv pip install --group typos --system
73+
- name: "rumdl"
74+
command: rumdl check .
10175

102-
- name: "Run typos"
103-
run: typos --config .typos.toml
76+
name: ${{ matrix.name }}
10477

105-
rumdl:
106-
name: "rumdl"
107-
runs-on: ubuntu-latest
10878
steps:
10979
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
11080
with:
@@ -117,13 +87,14 @@ jobs:
11787
- name: "Install uv"
11888
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
11989
with:
120-
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
90+
# zizmor: ignore[cache-poisoning]
91+
enable-cache: ${{ github.event_name == 'pull_request' }}
12192

122-
- name: "Install rumdl"
123-
run: uv pip install --group rumdl --system
93+
- name: "Install ${{ matrix.name }}"
94+
run: uv pip install --group ${{ matrix.name }} --system
12495

125-
- name: "Run rumdl"
126-
run: rumdl check .
96+
- name: "Run ${{ matrix.name }}"
97+
run: ${{ matrix.command }}
12798

12899
tests:
129100
uses: ./.github/workflows/tests.yaml
@@ -139,7 +110,8 @@ jobs:
139110
- name: "Install uv"
140111
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
141112
with:
142-
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
113+
# zizmor: ignore[cache-poisoning]
114+
enable-cache: ${{ github.event_name == 'pull_request' }}
143115

144116
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 # zizmor: ignore[cache-poisoning]
145117
with:
@@ -150,23 +122,23 @@ jobs:
150122
run: bash .github/scripts/15-bit.sh
151123

152124
linux:
153-
needs: [ tests, tests-15-bit-python, cargo-fmt, cargo-clippy, zizmor, typos, rumdl ]
125+
needs: [ tests, tests-15-bit-python, cargo-fmt, cargo-clippy, tools ]
154126
uses: ./.github/workflows/linux.yaml
155127

156128
musllinux:
157-
needs: [ tests, tests-15-bit-python, cargo-fmt, cargo-clippy, zizmor, typos, rumdl ]
129+
needs: [ tests, tests-15-bit-python, cargo-fmt, cargo-clippy, tools ]
158130
uses: ./.github/workflows/musllinux.yaml
159131

160132
windows:
161-
needs: [ tests, tests-15-bit-python, cargo-fmt, cargo-clippy, zizmor, typos, rumdl ]
133+
needs: [ tests, tests-15-bit-python, cargo-fmt, cargo-clippy, tools ]
162134
uses: ./.github/workflows/windows.yaml
163135

164136
macos:
165-
needs: [ tests, tests-15-bit-python, cargo-fmt, cargo-clippy, zizmor, typos, rumdl ]
137+
needs: [ tests, tests-15-bit-python, cargo-fmt, cargo-clippy, tools ]
166138
uses: ./.github/workflows/macos.yaml
167139

168140
wasm:
169-
needs: [ tests, tests-15-bit-python, cargo-fmt, cargo-clippy, zizmor, typos, rumdl ]
141+
needs: [ tests, tests-15-bit-python, cargo-fmt, cargo-clippy, tools ]
170142
uses: ./.github/workflows/wasm.yaml
171143

172144
build-sdist:
@@ -182,7 +154,6 @@ jobs:
182154
with:
183155
command: sdist
184156
args: --out dist
185-
rust-toolchain: nightly
186157

187158
- name: "Upload sdist"
188159
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -193,7 +164,7 @@ jobs:
193164
release:
194165
name: "Release"
195166
runs-on: ubuntu-latest
196-
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
167+
if: ${{ github.ref_type == 'tag' || github.event_name == 'workflow_dispatch' }}
197168
environment: pypi
198169
needs: [
199170
build-sdist,
@@ -219,32 +190,24 @@ jobs:
219190
subject-path: "wheels-*/*"
220191

221192
- name: "Install uv"
222-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
193+
if: ${{ github.ref_type == 'tag' }}
223194
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
224195
with:
225196
enable-cache: false
226197

227198
- name: "Publish to PyPI"
228-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
199+
if: ${{ github.ref_type == 'tag' }}
229200
run: uv publish 'wheels-*/*'
230201
env:
231202
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
232203

233-
- name: "Download wasm artifacts"
234-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
235-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
236-
with:
237-
pattern: wasm-wheels-*
238-
merge-multiple: true
239-
path: wasm
240-
241204
- name: "Upload wasm wheels to GitHub Release"
242-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
205+
if: ${{ github.ref_type == 'tag' }}
243206
run: |
244207
tag="${GITHUB_REF#refs/tags/}"
245208
gh release view "$tag" >/dev/null 2>&1 || \
246209
gh release create "$tag" --title "$tag" --notes ""
247-
gh release upload "$tag" wasm/*.whl --clobber
210+
gh release upload "$tag" wheels-wasm-*/*.whl --clobber
248211
env:
249212
GH_REPO: ${{ github.repository }}
250213
GH_TOKEN: ${{ github.token }}

.github/workflows/linux.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ jobs:
7070
- name: "Install uv"
7171
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
7272
with:
73-
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
73+
# zizmor: ignore[cache-poisoning]
74+
enable-cache: ${{ github.event_name == 'pull_request' }}
7475

7576
- name: "Build wheels"
76-
if: matrix.platform.use-pgo == false
7777
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
7878
with:
7979
target: ${{ matrix.platform.target }}
80-
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
80+
sccache: ${{ github.event_name == 'pull_request' }}
8181
manylinux: auto
8282
args: >
8383
--release

.github/workflows/macos.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,14 @@ jobs:
3838
- name: "Install uv"
3939
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
4040
with:
41-
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
41+
# zizmor: ignore[cache-poisoning]
42+
enable-cache: ${{ github.event_name == 'pull_request' }}
4243

4344
- name: "Build wheels"
4445
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
4546
with:
4647
target: ${{ matrix.platform.target }}
47-
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
48+
sccache: ${{ github.event_name == 'pull_request' }}
4849
args: >
4950
--release
5051
--out dist

.github/workflows/musllinux.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,17 @@ jobs:
5656
with:
5757
persist-credentials: false
5858

59+
- name: "Install uv"
60+
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
61+
with:
62+
# zizmor: ignore[cache-poisoning]
63+
enable-cache: ${{ github.event_name == 'pull_request' }}
64+
5965
- name: "Build wheels"
6066
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
6167
with:
6268
target: ${{ matrix.platform.target }}
63-
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
69+
sccache: ${{ github.event_name == 'pull_request' }}
6470
manylinux: musllinux_1_2
6571
args: >
6672
--release

.github/workflows/tests.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ jobs:
77
tests:
88
name: "${{ matrix.os }} / python ${{ matrix.python-version }}"
99
runs-on: ${{ matrix.os }}
10-
timeout-minutes: 10
1110
strategy:
1211
fail-fast: false
1312
matrix:
@@ -32,7 +31,13 @@ jobs:
3231
- name: "Install uv"
3332
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
3433
with:
35-
enable-cache: ${{ !startsWith(github.ref, 'refs/tags/') }} # zizmor: ignore[cache-poisoning]
34+
enable-cache: false
35+
36+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
37+
if: github.event_name == 'pull_request' && github.run_attempt == 1
38+
with:
39+
lookup-only: false # zizmor: ignore[cache-poisoning]
40+
shared-key: ${{ matrix.os }}-${{ matrix.python-version }}
3641

3742
- name: "Create and activate .venv"
3843
shell: bash
@@ -41,6 +46,7 @@ jobs:
4146
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
4247
echo ".venv/Scripts" >> "$GITHUB_PATH"
4348
echo "PYO3_PYTHON=.venv/Scripts/python" >> "$GITHUB_ENV"
49+
echo "UV_LINK_MODE=copy" >> "$GITHUB_ENV"
4450
else
4551
echo ".venv/bin" >> "$GITHUB_PATH"
4652
echo "PYO3_PYTHON=.venv/bin/python3" >> "$GITHUB_ENV"
@@ -50,7 +56,7 @@ jobs:
5056
run: uv pip install --group ci
5157

5258
- name: "Run maturin"
53-
run: maturin build --out wheel --release
59+
run: maturin build --out wheel --features mimalloc
5460

5561
- name: "Install built wheel"
5662
shell: bash

0 commit comments

Comments
 (0)