-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (78 loc) · 2.26 KB
/
lint.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
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
88
89
90
91
92
93
94
95
96
97
98
name: Lint
on:
push:
paths:
- '**.nix'
- '**.rs'
- Cargo.*
- flake.lock
pull_request:
workflow_dispatch:
jobs:
cargo-toml:
name: Cargo.toml
runs-on: ubuntu-22.04
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
extra-conf: |
log-lines = 500
- name: Set up Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v3
- name: Run taplo lint
run: nix develop -c taplo lint Cargo.toml
- name: Run taplo fmt
if: always()
run: nix develop -c taplo fmt --check Cargo.toml
rust:
name: Rust
runs-on: ubuntu-22.04
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
extra-conf: |
log-lines = 500
- name: Set up Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v3
- name: Set up build cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: build-${{ runner.os }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('flake.nix') }}-${{ hashFiles('**.lock') }}
- name: cargo clippy
run: nix develop -c cargo clippy -- -Dwarnings -Wclippy::pedantic
- name: cargo fmt
if: always()
run: nix develop -c cargo fmt --check
nix:
name: Nix
runs-on: ubuntu-22.04
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v9
with:
extra-conf: |
log-lines = 500
- name: Set up Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v3
- name: Check formatting
run: nix run nixpkgs#alejandra -- -c .
- name: Run static code analysis
if: always()
run: nix run nixpkgs#statix -- check
- name: Scan for dead code
if: always()
run: nix run nixpkgs#deadnix -- -f