-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (50 loc) · 1.28 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
51
52
name: ci
on:
pull_request:
branches:
- master
push:
branches:
- master
jobs:
test-and-lint:
name: test and lint
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions-rs/toolchain@v1
with:
components: clippy, rustfmt
override: true
toolchain: stable
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: fmt
run: cargo fmt --all -- --check --color always
- name: clippy
run: cargo clippy --all-features
- name: test
run: cargo test
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
cargo:
- '**/Cargo.lock'
- '**/Cargo.toml'
# Only run if there are changes to Cargo.toml or Cargo.lock
- if: steps.filter.outputs.cargo == 'true'
name: cargo-deny
uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check bans licenses sources