-
Notifications
You must be signed in to change notification settings - Fork 30
53 lines (43 loc) · 1.09 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
name: Rust CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
jobs:
rust:
name: Rust
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust:
- 1.75.0
- stable
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.rust }}
components: rustfmt, clippy
- name: Bump opt-level
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
- name: Compile (rust-analyzer)
run: cargo build --verbose
- name: Lint (clippy)
uses: giraffate/clippy-action@v1
with:
reporter: "github-pr-check"
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Format (rustfmt)
if: matrix.rust != 'stable'
run: cargo fmt-no-gen --check