-
Notifications
You must be signed in to change notification settings - Fork 35
43 lines (32 loc) · 1.08 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
name: 🥸 Lint
on:
push: { branches: [main] }
pull_request: { branches: [main] }
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
lint:
name: Lint the code
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Mark source directory as safe.
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Load environment variables from .env file
run: cat .env >> $GITHUB_ENV
- name: Show GOLANGCI_LINT_VERSION
run: echo "Linter version '$GOLANGCI_LINT_VERSION'"
- name: Set up Go
uses: actions/setup-go@v5
with: { go-version-file: go.mod }
- name: Check formatting using gofmt
run: gofmt -s -l -d .
- name: Check for suspicious constructs using "go vet"
run: go vet ./...
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
args: --verbose
version: ${{ env.GOLANGCI_LINT_VERSION }}