-
-
Notifications
You must be signed in to change notification settings - Fork 15
55 lines (51 loc) · 1.38 KB
/
build-and-test.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
name: Build & test
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
rust:
- stable
# - beta
- nightly
features:
- serde
- base64
- simd_backend
- default
os:
- ubuntu-latest
- macos-latest
- windows-latest
exclude:
- rust: stable
features: simd_backend
- rust: beta
features: simd_backend
- os: windows-latest
features: simd_backend
runs-on: ${{ matrix.os }}
env:
FEATURES: ${{ matrix.rust != 'nightly' && matrix.features || format('{0},nightly', matrix.features) }}
steps:
- uses: actions/checkout@v4
- name: Setup ${{ matrix.rust }} Rust toolchain with caching
uses: brndnmtthws/rust-action@v1
with:
toolchain: ${{ matrix.rust }}
- run: cargo build --features ${{ env.FEATURES }}
- run: cargo test --features ${{ env.FEATURES }}
env:
RUST_BACKTRACE: 1
- run: cargo fmt --all -- --check
if: ${{ matrix.rust == 'nightly' && matrix.os == 'ubuntu-latest' }}
- run: cargo clippy --features ${{ env.FEATURES }} -- -D warnings