-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (85 loc) · 2.48 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
name: Rust
on:
push:
branches:
- main
pull_request:
paths:
- .github/workflows/rust.yml
- Cargo.*
- crates/**
- rust-toolchain
- rustfmt.toml
defaults:
run:
shell: bash
jobs:
rustfmt:
name: Rustfmt
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Rust
uses: ./.github/actions/rust-toolchain-from-file
with:
components: rustfmt
- name: Rustfmt
run: cargo fmt --all -- --check
clippy:
strategy:
fail-fast: false
matrix:
target-triple:
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
include:
- { target-triple: x86_64-pc-windows-gnu, os: windows-2022 }
- { target-triple: x86_64-pc-windows-msvc, os: windows-2022 }
- { target-triple: x86_64-unknown-linux-gnu, os: ubuntu-22.04 }
name: Clippy (${{ matrix.target-triple }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Rust
uses: ./.github/actions/rust-toolchain-from-file
with:
targets: ${{ matrix.target-triple }}
components: clippy
- name: cargo-generate-lockfile
run: cargo generate-lockfile
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: cargo-clippy
run: cargo clippy --all-targets --target ${{ matrix.target-triple }} -- -D warnings
test:
strategy:
fail-fast: false
matrix:
target-triple:
- x86_64-pc-windows-gnu
- x86_64-pc-windows-msvc
- x86_64-unknown-linux-gnu
include:
- { target-triple: x86_64-pc-windows-gnu, os: windows-2022 }
- { target-triple: x86_64-pc-windows-msvc, os: windows-2022 }
- { target-triple: x86_64-unknown-linux-gnu, os: ubuntu-22.04 }
name: Test (${{ matrix.target-triple }})
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Rust
uses: ./.github/actions/rust-toolchain-from-file
with:
targets: ${{ matrix.target-triple }}
- name: cargo-generate-lockfile
run: cargo generate-lockfile
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: cargo-test
run: cargo test --target ${{ matrix.target-triple }}
env:
RUST_BACKTRACE: full