-
Notifications
You must be signed in to change notification settings - Fork 3
70 lines (56 loc) · 1.63 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Rust
on: [ push, pull_request ]
env:
CARGO_TERM_COLOR: always
jobs:
cog_check_job:
runs-on: ubuntu-latest
name: check conventional commit compliance
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
# pick the pr HEAD instead of the merge commit only if it's a PR, otherwise use the default
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Conventional commit check
uses: cocogitto/cocogitto-action@v3
with:
check-latest-tag-only: true
test:
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
rust:
- stable
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@just
- name: Install toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Format
run: cargo fmt -- --check
- name: Lint
run: just lint
- uses: taiki-e/install-action@just
- name: Install cargo-binstall
uses: cargo-bins/cargo-binstall@main
- name: Install cargo-shear
run: cargo binstall --no-confirm cargo-shear
- name: Check for unused dependencies
run: cargo shear
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --verbose
- name: Run tests
env:
RUST_BACKTRACE: "full"
run: just test