-
Notifications
You must be signed in to change notification settings - Fork 1
50 lines (46 loc) · 1.14 KB
/
CI.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
name: CI
on:
push:
branches:
- master
merge_group:
pull_request:
branches:
- "**"
paths:
- "Cargo.toml"
- "Cargo.lock"
- "**.rs"
- ".github**"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} # cancels previous runs on the same PR / commit group
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
rustfmt:
name: Rustfmt
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- name: Check formatting
run: cargo +nightly fmt -- --check
clippy:
name: Clippy
needs: rustfmt
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Install Clang
run: sudo apt-get update && sudo apt-get install -y clang
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Clippy check
run: cargo clippy --all-targets --all-features -- -D warnings