-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (47 loc) · 1.2 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
name: CI
on:
push:
jobs:
check:
name: Checks and lints
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Check Rust formatting
run: |
nix develop --command \
cargo fmt --check
- name: Clippy
run: |
nix develop --command \
cargo clippy --workspace --no-deps
build_and_test:
name: Build and test
needs: check
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v3
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Set up Rust cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: |
nix develop --command \
cargo build --workspace
- name: Test
run: |
nix develop --command \
cargo test --workspace