Repository navigation
140 lines (131 loc) · 4.86 KB
/
Copy pathci.yml
File metadata and controls
140 lines (131 loc) · 4.86 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
name: CI
on:
push:
branches: [master, main]
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Clippy
run: |
cargo clippy --workspace --all-targets -- -D warnings
cargo clippy --workspace --all-targets --features python -- -D warnings
cargo clippy --all-targets --features 'rayon,wgpu,python' -- -D warnings # the command the README tells users to run
cargo clippy --workspace --all-targets --features 'python,secure-crypto,fhe' -- -D warnings # what the wheel ships
# The vetted-crate crypto (ML-KEM, Feldman VSS, Groth16, TFHE) is behind features the plain test job never enables,
# yet the wheel builds with them on (pyproject.toml). tfhe needs Rust >= 1.91, newer than the crate's MSRV.
crypto:
name: cargo test (secure-crypto + fhe)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Test
run: cargo test --workspace --no-fail-fast --release --features 'python,secure-crypto,fhe'
test:
name: cargo test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
defaults:
run:
shell: bash # a failing command must fail the step on Windows too (PowerShell only reports the last exit code)
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Test
run: cargo test --workspace --no-fail-fast
# The Python assertion blocks inside the Rust tests are compiled out without the `python` feature.
- name: Test with the Python feature
run: cargo test --workspace --no-fail-fast --features python
# Stack-depth and overflow behavior differs between profiles: the
# robustness suite caught a release-only stack overflow (batch AR)
# that the debug runs above cannot see.
- name: Robustness tests (release profile, Ubuntu only)
if: matrix.os == 'ubuntu-latest'
run: cargo test --release --test robustness
# Build and exercise the macOS wheel in the same runner instead of queuing two additional
# hosted arm64 macOS jobs (which hit hosted-runner acquisition timeouts under queue contention).
- name: Wheel build and test (macOS, Python 3.12)
if: matrix.os == 'macos-latest'
run: |
python -m pip install maturin numpy
maturin build --out dist
python -m pip install --no-index --find-links dist oxideon
python tests/test_python_package.py
python tests/test_python_ergonomics.py
# The wheel is built once per OS (the extension is abi3, so one wheel serves every supported Python) and then
# installed and exercised under each supported Python version below.
wheel:
name: build wheel (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-latest]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: python -m pip install maturin
- run: maturin build --out dist
- uses: actions/upload-artifact@v4
with:
name: ci-wheel-${{ matrix.os }}
path: dist
wheel-test:
name: wheel on ${{ matrix.os }}, Python ${{ matrix.python }}
needs: wheel
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
# ubuntu-latest is now 26.04, which setup-python has no Python 3.9 for: the wheel jobs are pinned to 24.04
matrix:
os: [ubuntu-24.04, windows-latest]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@v4
with:
name: ci-wheel-${{ matrix.os }}
path: dist
- name: Install the wheel (not the source tree)
run: python -m pip install numpy && python -m pip install --no-index --find-links dist oxideon
- name: Tests
run: |
python tests/test_python_package.py
python tests/test_python_ergonomics.py
- name: Stub freshness
if: matrix.os == 'ubuntu-24.04' && matrix.python == '3.12'
run: |
python tools/gen_stubs.py
git diff --exit-code -- python/oxideon