-
Notifications
You must be signed in to change notification settings - Fork 76
63 lines (58 loc) · 1.86 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
#
# Configuration for GitHub-based CI, based on the stock GitHub Rust config.
#
name: Rust
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
check-style:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Report cargo version
run: cargo --version
- name: Report rustfmt version
run: cargo fmt -- --version
- name: Check style
run: cargo fmt -- --check
clippy-lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Report cargo version
run: cargo --version
- name: Report Clippy version
run: cargo clippy -- --version
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
- name: Run Clippy Lints
run: cargo clippy --all-targets -- --deny warnings
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-14 for M1 runners
os: [ubuntu-22.04, windows-2022, macos-14]
features: [all, default]
include:
- features: all
feature_flags: --all-features
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Report cargo version
run: cargo --version
- name: Report rustc version
run: rustc --version
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
with:
# Matrix instances other than OS need to be added to this explicitly
key: ${{ matrix.features }}
- name: Build
run: cargo build ${{ matrix.feature_flags }} --locked --all-targets --verbose
- name: Run tests
run: cargo test ${{ matrix.feature_flags }} --locked --all-targets --verbose