-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.47 KB
/
check.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
52
53
54
55
56
57
# The default GitHub runner image comes with a bunch of software preinstalled.
# Typically this doesn't matter, however with Cargo it appears to interfere,
# hence the `rm -rf ~/.cargo/` steps.
name: Check
on:
push:
jobs:
validate:
name: Validate Nix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v22
- run: nix flake check
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rm -rf ~/.cargo/
- uses: cachix/install-nix-action@v22
- uses: ./.github/actions/cargo-cache
- run: nix develop -c cargo check
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rm -rf ~/.cargo/
- uses: cachix/install-nix-action@v22
- uses: ./.github/actions/cargo-cache
- run: nix develop -c cargo test
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rm -rf ~/.cargo/
- uses: cachix/install-nix-action@v22
- uses: ./.github/actions/cargo-cache
# See: https://github.com/rust-lang/rust-clippy/issues/1209
- run: RUSTFLAGS="-D warnings" nix develop -c cargo clippy --all-targets
fmt:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rm -rf ~/.cargo/
- uses: cachix/install-nix-action@v22
- run: nix develop -c cargo fmt --check