-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (41 loc) · 1.08 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
on:
push:
branches: [main]
pull_request:
merge_group:
jobs:
ci:
name: CI
runs-on: ubuntu-latest
needs: [test, lint]
if: always()
steps:
- name: Done
run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry and index
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- name: Cache cargo build
uses: actions/cache@v4
with:
path: target
key: ${{ runner.os }}-target-${{ matrix.rust }}-${{ hashFiles('**/Cargo.toml') }}
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --verbose --release
- run: cargo test --verbose
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: "rustfmt"
- run: cargo fmt -- --check