-
Notifications
You must be signed in to change notification settings - Fork 3
38 lines (32 loc) · 935 Bytes
/
lint.yml
File metadata and controls
38 lines (32 loc) · 935 Bytes
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
name: Lint
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test-go:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v5.0.0
- uses: actions/setup-go@v5
with:
go-version: 1.22.8
- name: Get golangci-lint cache dir
run: |
linter_ver=1.64.8
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v$linter_ver
dir=$(golangci-lint cache status | awk '/Dir/ { print $2 }')
echo "LINT_CACHE_DIR=$dir" >> $GITHUB_ENV
- name: golangci-lint cache
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
${{ env.LINT_CACHE_DIR }}
key: golangci-lint-${{ runner.os }}-${{ hashFiles('**/*.go') }}
restore-keys: |
golangci-lint-${{ runner.os }}-