forked from Argus-Labs/world-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.28 KB
/
lint-go.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
name: Lint
on:
pull_request:
types: [ opened, synchronize, reopened, ready_for_review ]
paths-ignore:
- "docs/**"
push:
branches:
- main
paths-ignore:
- "docs/**"
permissions:
contents: read
jobs:
lint-go:
name: Go
runs-on: namespace-profile-linux-4vcpu-8gb-cached
env:
GO_VERSION: 1.22.1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
## skip cache, use Namespace volume cache
cache: false
- name: Setup Namespace cache
uses: namespacelabs/nscloud-cache-action@v1
with:
cache: go
path: |
/home/runner/go/pkg
/home/runner/.cache/go-build
/home/runner/.cache/golangci-lint
- name: Find go path
id: go-dir
run: echo "path=$(go list -f '{{.Dir}}/...' -m | xargs)" >> $GITHUB_OUTPUT
## Equivalent to 'make lint' arguments
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.57.1
args: --timeout=10m -v ${{ steps.go-dir.outputs.path }}
## skip cache, use Namespace volume cache
skip-cache: true