-
Notifications
You must be signed in to change notification settings - Fork 27
44 lines (41 loc) · 1.2 KB
/
pre-commit-linter.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
name: Linter
on:
push:
tags:
- "*"
branches:
- master
- main
pull_request:
jobs:
linter:
name: linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
# We embed the contents of web_ui/frontend/out/* into the resulting binaries
# That particular directory should contain outputs generated by the
# npm build. However, to keep the runtime of the linter as fast as possible,
# instead of running `npm` here, we simply create a dummy empty file.
#
# If no dummy file exists, then the linters will flag the situation as
# an error.
- name: Generate placeholder files
id: generate-placeholder
run: |
go generate ./...
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
# We still run this so that we can get the nice hint of gofmt issues inline
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: latest
- name: Run pre-commit
uses: pre-commit/[email protected]