-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (67 loc) · 1.82 KB
/
rust.yaml
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
name: Rust
on: push
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: 1.82.0
jobs:
test:
name: Test / ${{ matrix.target }} ${{ matrix.opt }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
opt:
- ''
- --release
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: aarch64-apple-darwin
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: moonrepo/setup-rust@v1
with:
channel: ${{ env.RUST_TOOLCHAIN }}
- name: Run tests
# Ensure debug output is also tested
env:
RUST_LOG: debug
run: cargo test --all-features ${{ matrix.opt }}
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: moonrepo/setup-rust@v1
with:
channel: ${{ env.RUST_TOOLCHAIN }}
- name: Check project and dependencies
run: cargo check
fmt:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: moonrepo/setup-rust@v1
with:
components: rustfmt
channel: ${{ env.RUST_TOOLCHAIN }}
- name: Check formatting
run: cargo fmt -- --check
clippy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: moonrepo/setup-rust@v1
with:
components: clippy
channel: ${{ env.RUST_TOOLCHAIN }}
- name: Check code with clippy
run: cargo clippy -- -D warnings --no-deps