-
Notifications
You must be signed in to change notification settings - Fork 11
59 lines (47 loc) · 1.29 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: CI
run-name: "CI run '${{ github.head_ref || github.ref_name }}'"
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
merge_group:
defaults:
run:
shell: bash
jobs:
ci:
strategy:
matrix:
os: ["ubuntu-latest"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Cache
id: rust-cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml', '.github/workflows/*.yml') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.75.0
components: rustfmt, clippy
default: true
- name: Install cargo-deny
if: steps.rust-cache.outputs.cache-hit != 'true'
run: rustup run --install 1.70 cargo install --force --version 0.14.3 cargo-deny --locked
- name: Compile
run: cargo build --all-targets --all-features
- name: Run tests
run: make test
- name: Clippy
run: cargo clippy --all --all-targets -- -Dwarnings
- name: Format
run: cargo fmt --all -- --check