-
Notifications
You must be signed in to change notification settings - Fork 3
36 lines (36 loc) · 991 Bytes
/
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
name: validate
on:
push:
branches:
- main
pull_request:
jobs:
go-lint:
name: golangci-lint
runs-on: ubuntu-20.04
env:
REPOSITORY: ${{ github.repository }}
steps:
- name: Set up Go env
uses: actions/setup-go@v5
with:
go-version: '1.20'
- uses: actions/checkout@v4
with:
fetch-depth: 1
path: go/src/github.com/${{ env.REPOSITORY }}
- name: Set $GOPATH
run: |
echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV
echo "${{ github.workspace }}/go/bin" >> $GITHUB_PATH
shell: bash
- name: Prepare codebase for linter (generates deps, stubs)
run: |
cd go/src/github.com/${{ env.REPOSITORY }}
make deps generate
shell: bash
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.53
working-directory: go/src/github.com/${{ env.REPOSITORY }}