-
Notifications
You must be signed in to change notification settings - Fork 47
145 lines (136 loc) · 3.78 KB
/
rust.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
name: Continuous integration
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
# Ensure the crate builds on x86
build_x86_64:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, nightly]
features: ["+avx2", "+sse2"]
env:
RUSTFLAGS: "-C target-feature=${{matrix.features}} -D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: x86_64-unknown-linux-gnu
toolchain: ${{ matrix.rust }}
components: clippy
- name: Tests (x86_64)
run: |
cargo clippy &&
cargo test -v --no-default-features --tests --lib &&
cargo build --verbose --features "$FEATURES" &&
cargo test --verbose --features "$FEATURES" &&
cargo test --verbose --release --features "$FEATURES"
# Ensure the crate builds on x86
build_MSRV:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [1.56.0]
features: ["+avx2", "+sse2"]
env:
RUSTFLAGS: "-C target-feature=${{matrix.features}}"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: x86_64-unknown-linux-gnu
toolchain: ${{ matrix.rust }}
components: clippy
- name: Tests (x86_64)
run: |
cargo clippy &&
cargo test -v --no-default-features --tests --lib &&
cargo build --verbose --features "$FEATURES" &&
cargo test --verbose --features "$FEATURES" &&
cargo test --verbose --release --features "$FEATURES"
# Ensure the crate builds on ARM
build_aarch64:
runs-on: macos-14
strategy:
matrix:
rust: [stable, nightly]
features: ["+neon", "-neon"]
env:
RUSTFLAGS: "-C target-feature=${{matrix.features}} -D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: aarch64-apple-darwin
toolchain: ${{ matrix.rust }}
components: clippy
- name: Tests (aarch64)
run: |
cargo clippy &&
cargo test -v --no-default-features --tests --lib &&
cargo build --verbose --features "$FEATURES" &&
cargo test --verbose --features "$FEATURES" &&
cargo test --verbose --release --features "$FEATURES"
# Enforce rustfmt formatting
formatting:
runs-on: ubuntu-latest
strategy:
matrix:
# Run formatting checks only on stable
rust: [stable]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
components: rustfmt
- name: Run Clippy
run: |
cargo fmt --all --check
# Ensure the benchmarks compile
benchmark_compiles:
runs-on: ubuntu-latest
strategy:
matrix:
# Check builds only on stable
rust: [stable]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
components: clippy
- name: Run Clippy
run: |
cd benches
cargo bench --bench benches --no-run
build-wasm:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown
- name: Check wasm
run: cargo check --target wasm32-unknown-unknown
miri:
runs-on: ubuntu-latest
strategy:
matrix:
# Check builds only on nightly
rust: [nightly]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.rust }}
components: miri
- name: Run miri
run: cargo miri test