-
Notifications
You must be signed in to change notification settings - Fork 90
72 lines (63 loc) · 1.91 KB
/
lint.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Lints
on:
workflow_call:
jobs:
# A separate Go-Lint job since the current lint job is heavily
# coupled with a lot of tooling, which will be removed and
# simplified, one step at a time.
# For now, we are just extracting the go-lint.
go-lint:
strategy:
matrix:
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.work
- name: Setup Dummy WebUi Build
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p webui/build && touch webui/build/index.html
- uses: golangci/golangci-lint-action@v6
with:
skip-cache: true
# TODO: Decouple Each Component Linting
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# Install SQLite before asdf to ensure Python is built with SQLite support
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libsqlite3-dev
- name: Set Go Version
shell: bash
run: |
set -euo pipefail
echo "GO_VER=$(cat .tool-versions | grep 'golang ' | cut -d' ' -f2)" >> $GITHUB_ENV
- name: Set Node Version
shell: bash
run: |
set -euo pipefail
echo "NODE_VER=$(cat .tool-versions | grep nodejs | cut -d' ' -f2)" >> $GITHUB_ENV
- name: Install asdf & tools
uses: asdf-vm/actions/install@v3
- name: Add asdf to PATH
shell: bash
run: |
set -euo pipefail
echo "~/.asdf/shims" >> $GITHUB_PATH
- name: Go Tidy
shell: bash
run: |
set -euo pipefail
go mod tidy
- name: Run pre-commit
shell: bash
run: |
set -euo pipefail
pre-commit run --show-diff-on-failure --color=always --all-files