-
Notifications
You must be signed in to change notification settings - Fork 203
73 lines (70 loc) · 2.15 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
name: Rust
on:
pull_request:
branches:
- "*"
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
fail-fast: false
matrix:
info:
- {
os: "ubuntu-latest",
target: "x86_64-unknown-linux-gnu",
cross: false,
}
- {
os: "ubuntu-latest",
target: "x86_64-unknown-linux-musl",
cross: true,
}
# - { os: "macOS-latest", target: "x86_64-apple-darwin", cross: false }
# - { os: "macOS-latest", target: "aarch64-apple-darwin", cross: false }
- {
os: "windows-latest",
target: "x86_64-pc-windows-msvc",
cross: false,
}
- {
os: "windows-latest",
target: "i686-pc-windows-msvc",
cross: true,
}
runs-on: ${{ matrix.info.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Rust toolchain
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
targets: ${{ matrix.info.target }}
- name: Enable Rust cache
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
uses: Swatinem/rust-cache@6fd3edff6979b79f87531400ad694fb7f2c84b1f #2.1.0
- name: Fmt Check
run: cargo fmt -- --check
- name: Prepare Clippy
run: rustup component add clippy
- name: Run clippy action to produce annotations
run: cargo clippy --all-targets -- -D warnings
- name: Build tests
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
uses: ClementTsang/cargo-action@v0.0.3
with:
command: test
args: --no-run --locked ${{ matrix.features }} --target=${{ matrix.info.target }}
use-cross: ${{ matrix.info.cross }}
cross-version: 0.2.4
env:
RUST_BACKTRACE: full
- name: Run tests
env:
RUST_TEST_THREADS: 1
run: cargo test --verbose