-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (37 loc) · 973 Bytes
/
ci.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
on:
push:
paths:
- '**.rs'
- '**.toml'
- '**.yml'
- '.git*'
- 'Cargo.lock'
- 'README.md' # it's included in the crate root
branches:
- main
name: ci
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup rust toolchain
id: toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt, clippy
- name: setup cache
uses: actions/cache@v4
with:
path: |
~/.cargo
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-rustc-${{ steps.toolchain.outputs.cachekey }}
- name: cargo test
run: cargo test --lib --bins --tests
- name: cargo fmt
run: cargo fmt --all -- --check
- name: cargo clippy
run: cargo clippy --all-targets --all-features -- -D warnings