-
Notifications
You must be signed in to change notification settings - Fork 27
218 lines (209 loc) · 8.8 KB
/
ci.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: "17 3 * * *"
env:
CARGO_TERM_COLOR: always
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest, macos-13]
toolchain: ["1.38.0", "1.61.0", stable, beta, nightly]
exclude:
- os: macos-latest
toolchain: "1.38.0" # macOS ARM64 is not supported by 1.38.0
- os: macos-13
toolchain: "1.38.0" # macOS is not supported by 1.38.0 (flexpect)
- toolchain: "1.61.0" # only macos
include:
- os: macos-latest
toolchain: "1.61.0"
- os: macos-13
toolchain: "1.61.0"
env:
RUSTFLAGS: "-D warnings"
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: Run tests
run: |
for features in "" "--features std" "--features public_imp" "--features std,public_imp"; do
cargo clean; cargo test --release --no-default-features $features --all-targets --verbose
done
- name: Run with SSE4.2 + AVX2 target features
run: |
for features in "" "--features std" "--features public_imp" "--features std,public_imp"; do
cargo clean
RUSTFLAGS="-D warnings -C target-feature=+sse4.2" cargo test --release --no-default-features $features --all-targets --verbose
cargo clean
RUSTFLAGS="-D warnings -C target-feature=+avx2" cargo test --release --no-default-features $features --all-targets --verbose
done
shell: bash
if: ${{ matrix.os != 'macos-latest'}}
- name: Run tests with all features on nightly
run: cargo test --release --all-features --all-targets --verbose
if: ${{ matrix.toolchain == 'nightly'}}
- name: Run test with all features and with SSE4.2 + AVX2 target features on nightly
run: |
cargo clean
RUSTFLAGS="-D warnings -C target-feature=+sse4.2" cargo test --release --all-features --all-targets --verbose
cargo clean
RUSTFLAGS="-D warnings -C target-feature=+avx2" cargo test --release --all-features --all-targets --verbose
shell: bash
if: ${{ matrix.os != 'macos-latest' && matrix.toolchain == 'nightly' }}
test-win32:
runs-on: windows-latest
strategy:
matrix:
toolchain: ["1.38.0", stable, beta, nightly]
env:
RUSTFLAGS: "-D warnings"
CARGO_BUILD_TARGET: "i686-pc-windows-msvc"
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
targets: "i686-pc-windows-msvc"
- name: Run tests
run: |
for features in "" "--features std" "--features public_imp" "--features std,public_imp"; do
cargo clean; cargo test --release --no-default-features $features --all-targets --verbose
done
- name: Run with SSE4.2 + AVX2 target features
run: |
for features in "" "--features std" "--features public_imp" "--features std,public_imp"; do
cargo clean
RUSTFLAGS="-D warnings -C target-feature=+sse4.2" cargo test --release --no-default-features $features --all-targets --verbose
cargo clean
RUSTFLAGS="-D warnings -C target-feature=+avx2" cargo test --release --no-default-features $features --all-targets --verbose
done
shell: bash
- name: Run tests with all features on nightly
run: cargo test --release --all-features --all-targets --verbose
if: ${{ matrix.toolchain == 'nightly'}}
- name: Run test with all features and with SSE4.2 + AVX2 target features on nightly
run: |
cargo clean
RUSTFLAGS="-D warnings -C target-feature=+sse4.2" cargo test --release --all-features --all-targets --verbose
cargo clean
RUSTFLAGS="-D warnings -C target-feature=+avx2" cargo test --release --all-features --all-targets --verbose
shell: bash
if: ${{ matrix.toolchain == 'nightly' }}
test-inlining:
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: ["1.38.0", stable, beta, nightly]
defaults:
run:
working-directory: inlining
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
targets: "x86_64-unknown-linux-gnu"
components: "llvm-tools-preview"
- name: Install stable toolchain
run: rustup toolchain add stable
- name: Install rustfilt
run: cargo +stable install rustfilt
- name: Check x86_64 inlining
run: |
./check-inlining.sh x86_64-unknown-linux-gnu expected-methods-x86-std.txt
./check-inlining.sh x86_64-unknown-linux-gnu expected-methods-x86-std.txt "--features public_imp"
RUSTFLAGS="-C target-feature=+avx2" ./check-inlining.sh x86_64-unknown-linux-gnu expected-methods-x86-std-avx2.txt
RUSTFLAGS="-C target-feature=+avx2" ./check-inlining.sh x86_64-unknown-linux-gnu expected-methods-x86-nostd-avx2.txt --no-default-features
RUSTFLAGS="-C target-feature=+sse4.2" ./check-inlining.sh x86_64-unknown-linux-gnu expected-methods-x86-nostd-sse42.txt --no-default-features
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
targets: "aarch64-apple-darwin aarch64-unknown-linux-gnu armv7-unknown-linux-gnueabihf"
components: "llvm-tools-preview"
if: ${{ matrix.toolchain != '1.38.0' }}
- name: Check aarch64 inlining
run: |
for target in aarch64-unknown-linux-gnu aarch64-apple-darwin
do
./check-inlining.sh $target expected-methods-aarch64-neon.txt
./check-inlining.sh $target expected-methods-aarch64-neon.txt --no-default-features
./check-inlining.sh $target expected-methods-aarch64-neon.txt "--features public_imp"
done
if: ${{ matrix.toolchain != '1.38.0' }}
- name: Check armv7 neon inlining
run: |
./check-inlining.sh armv7-unknown-linux-gnueabihf expected-methods-armv7-std.txt "--features armv7_neon"
./check-inlining.sh armv7-unknown-linux-gnueabihf expected-methods-armv7-std.txt "--features armv7_neon,public_imp"
RUSTFLAGS="-C target-feature=+neon" ./check-inlining.sh armv7-unknown-linux-gnueabihf expected-methods-armv7-neon.txt "--features armv7_neon"
RUSTFLAGS="-C target-feature=+neon" ./check-inlining.sh armv7-unknown-linux-gnueabihf expected-methods-armv7-neon.txt "--no-default-features --features armv7_neon"
if: ${{ matrix.toolchain == 'nightly' }}
test-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
- name: Run cargo doc
run: cargo doc --features public_imp
env:
RUSTDOCFLAGS: --cfg docsrs
fmt_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check formatting
run: cargo fmt -- --check
clippy_check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- name: Clippy - default
run: cargo clippy --all-targets
- name: Clippy - all features enabled
run: cargo clippy --all-targets --all-features
- name: Clippy - all features disabled
run: cargo clippy --all-targets --no-default-features
clippy_check_arm:
runs-on: ubuntu-latest
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
targets: "thumbv7neon-unknown-linux-gnueabihf, armv7-unknown-linux-gnueabihf, armv7-linux-androideabi"
- name: Run Clippy
run: |
for target in thumbv7neon-unknown-linux-gnueabihf armv7-unknown-linux-gnueabihf armv7-linux-androideabi; do
cargo clippy --target $target --all-targets
cargo clippy --target $target --all-targets --all-features
cargo clippy --target $target --all-targets --no-default-features
cargo clippy --target $target --all-targets --no-default-features --features armv7_neon
cargo clippy --target $target --all-targets --no-default-features --features armv7_neon,public_imp
done