-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (41 loc) · 1.11 KB
/
ci-rust.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
name: Rust CI
on:
pull_request:
paths:
- 'rs/**'
- '.github/**'
push:
branches:
- main
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Rust
uses: moonrepo/setup-rust@v1
with:
channel: stable
profile: minimal # Faster, no docs
components: rustfmt, clippy
cache: true
- name: Build the workspace
working-directory: rs
run: cargo build --workspace --all-targets
- name: Format check
working-directory: rs
run: cargo fmt -- --check
- name: Lint the code
working-directory: rs
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Run tests
working-directory: rs
run: cargo test --workspace
# - name: Cache Cargo
# uses: actions/cache@v3
# with:
# path: ~/.cargo/registry
# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: |
# ${{ runner.os }}-cargo-