-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (74 loc) · 2.23 KB
/
code-quality.yaml
File metadata and controls
74 lines (74 loc) · 2.23 KB
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
name: Code Quality Check
on:
workflow_dispatch:
push:
paths:
- "**.nix"
- "flake.nix"
- ".github/workflows/code-quality.yaml"
jobs:
statix:
name: Code Linting
runs-on: ubuntu-latest
timeout-minutes: 30
# strategy:
# fail-fast: false
concurrency:
group: ${{ github.workflow }}-lint
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 1
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
logger: pretty
# - name: Cache
# uses: DeterminateSystems/flakehub-cache-action@main
- name: Linting
run: |
echo "# Statix Check" >> $GITHUB_STEP_SUMMARY
echo "~~~console" >> $GITHUB_STEP_SUMMARY
nix run nixpkgs#statix -- check --ignore hardware-configuration.nix | sed 's/\x1b\[[0-9;]*m//g' >> $GITHUB_STEP_SUMMARY || true
# nix run nixpkgs#statix -- check --ignore hardware-configuration.nix -o errfmt >> $GITHUB_STEP_SUMMARY || true
echo "~~~" >> $GITHUB_STEP_SUMMARY
deadnix:
name: Dead Code Check
runs-on: ubuntu-latest
timeout-minutes: 30
# strategy:
# fail-fast: false
concurrency:
group: ${{ github.workflow }}-dead
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 1
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
logger: pretty
# - name: Cache
# uses: DeterminateSystems/flakehub-cache-action@main
- name: Dead Code
env:
NO_COLOR: true
run: |
echo "# Deadnix Check" >> $GITHUB_STEP_SUMMARY
echo "~~~console" >> $GITHUB_STEP_SUMMARY
nix run nixpkgs#deadnix >> $GITHUB_STEP_SUMMARY
echo "~~~" >> $GITHUB_STEP_SUMMARY