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
name: CI
on:
push:
branches:
pull_request:
workflow_dispatch:
# Cancel in-progress runs on the same ref/PR when a new push lands. Saves
# CI minutes when developers push corrections in quick succession.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
PYTHON_VERSION: "3.12"
jobs:
# ──────────────────────────────────────────────────────────────────
# Rust: formatting + clippy.
# ──────────────────────────────────────────────────────────────────
rust-fmt-clippy:
name: rust · fmt + clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-toolchain
with:
cache-key: rust-clippy
- run: cargo fmt --all --check
- run: cargo clippy --workspace --all-targets -- -D warnings
# ──────────────────────────────────────────────────────────────────
# Rust: workspace test suite.
# ──────────────────────────────────────────────────────────────────
rust-test:
name: rust · cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-toolchain
with:
cache-key: rust-test
- run: cargo test --no-run --locked
- run: cargo test --locked
# ──────────────────────────────────────────────────────────────────
# Wheel build: For shipping `arrs` to pure Python users
# ──────────────────────────────────────────────────────────────────
wheel:
name: wheel · ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-toolchain
with:
cache-key: wheel-${{ matrix.os }}
python: "true"
python-version: ${{ env.PYTHON_VERSION }}
- name: Build release wheel
run: uvx maturin build --release --out dist
- uses: actions/upload-artifact@v7
with:
name: wheel-${{ matrix.os }}
path: dist/*.whl
if-no-files-found: error
retention-days: 7
# ──────────────────────────────────────────────────────────────────
# Aggregator: a single required check for branch-protection rules,
# so we don't have to keep the protected-checks list in sync with
# job names.
# ──────────────────────────────────────────────────────────────────
ci:
name: ci
if: always()
needs:
runs-on: ubuntu-latest
steps:
- name: Fail if any required job failed
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1
- run: echo "All required jobs passed."