-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (74 loc) · 2.35 KB
/
ci.yml
File metadata and controls
87 lines (74 loc) · 2.35 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
on:
pull_request:
branches: [ main, develop ]
push:
branches: [ main, develop ]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test, Format, and Lint
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable]
include:
- rust: stable
check_fmt: true
check_clippy: true
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: ${{ matrix.check_fmt && 'rustfmt' || '' }}${{ matrix.check_clippy && matrix.check_fmt && ',' || '' }}${{ matrix.check_clippy && 'clippy' || '' }}
- name: Cache cargo registry and dependencies
uses: actions/cache@v4
continue-on-error: true
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-${{ matrix.rust }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.rust }}-cargo-test-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-${{ matrix.rust }}-cargo-test-
${{ runner.os }}-${{ matrix.rust }}-cargo-
${{ runner.os }}-cargo-
- name: Check formatting
if: matrix.check_fmt
run: cargo fmt -- --check
- name: Run clippy
if: matrix.check_clippy
run: make clippy
- name: Run compile check
run: make compile
- name: Run tests
run: make test
build:
name: Build Verification
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo registry and dependencies
uses: actions/cache@v4
continue-on-error: true
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
target
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-
${{ runner.os }}-cargo-build-
${{ runner.os }}-cargo-
- name: Run build check
run: make build