-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (45 loc) · 1.09 KB
/
ci.yml
File metadata and controls
49 lines (45 loc) · 1.09 KB
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
name: CI
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
env:
CARGO_TERM_COLOR: always
RUST_VERSION_STABLE: stable
jobs:
test:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION_STABLE }}
profile: minimal
override: true
- name: Build
run: cargo build --all-targets
- name: Test
run: cargo test
lint:
runs-on: ubuntu-22.04
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_VERSION_STABLE }}
profile: minimal
components: rustfmt, clippy
override: true
- name: Run clippy
run: cargo clippy --all-targets -- -D warnings $(cat .lints | cut -f1 -d"#" | tr '\n' ' ')
- name: Run rustfmt
run: cargo fmt -- --check