-
Notifications
You must be signed in to change notification settings - Fork 51
63 lines (51 loc) · 1.72 KB
/
lint.yml
File metadata and controls
63 lines (51 loc) · 1.72 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
# Copyright 2026 Phillip Cloud
# Licensed under the Apache License, Version 2.0
name: Lint
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
jobs:
deadcode:
name: Dead Code
runs-on: ubuntu-latest
concurrency:
group: lint-deadcode-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31
- name: Run deadcode
run: nix run '.#deadcode'
golangci-lint:
name: Lint
runs-on: ubuntu-latest
concurrency:
group: lint-golangci-lint-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31
- name: Run golangci-lint
run: nix run '.#golangci-lint'
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
concurrency:
group: lint-pre-commit-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
persist-credentials: false
- uses: cachix/install-nix-action@4e002c8ec80594ecd40e759629461e26c8abed15 # v31
- name: Run pre-commit hooks
run: nix run '.#pre-commit' -- --from-ref 'origin/${{ github.base_ref || 'main' }}' --to-ref HEAD