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
name: CI
on:
push:
branches:
pull_request:
# Cancel superseded runs on the same ref.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
lint:
name: rustfmt + clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- name: rustfmt
run: cargo fmt --all --check
# `-- -D warnings` denies lints in *our* crate only; dependencies are built (not linted)
# by clippy, so their warnings can't fail the build.
- name: clippy
run: cargo clippy --all-targets --all-features --locked -- -D warnings
test:
name: test (${{ matrix.os }}, backend=${{ matrix.backend }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# Run the whole suite on both x86-64 and aarch64. NEON is mandatory on aarch64, so the
# ARM runner is load-bearing once the SIMD backends land.
os:
# Force scalar for the whole suite. We deliberately do NOT add a matrix entry per SIMD
# backend: forcing (say) HYALITE_BACKEND=avx2 globally would make every test that builds a
# non-i8-eligible database fail with the (correct) BackendUnavailable error. Cross-backend
# determinism is instead covered directly by the `scan_identical_across_simd_backends`
# proptest, which forces each *available* SIMD backend only on eligible databases. The
# aarch64 runner exercises NEON, and the x86-64 runner SSE4.1/AVX2, through that test.
backend:
env:
# Force the backend so a mismatch (e.g. the CPU lacks the forced ISA) fails loudly rather
# than silently falling back. `HYALITE_BACKEND` is read at Database::build.
HYALITE_BACKEND: ${{ matrix.backend }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
# Plain `cargo test` also runs doctests (which `--all-targets` would skip).
- name: test
run: cargo test --all-features --locked