-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.4 KB
/
golang_quality.yaml
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
51
52
on:
workflow_call:
inputs:
workdir:
required: false
default: "./"
type: string
permissions:
# Required by golangci job to write annotations to the merge request.
contents: read
checks: write
jobs:
golangci:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: v1.23.3
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
working-directory: "${{ inputs.workdir }}"
go_tidy:
runs-on: ubuntu-latest
container:
image: cubicrootxyz/golang-ci:v1.23.3
options: --user root
steps:
- uses: actions/checkout@v4
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Run go mod tidy
run: (cd ${{ inputs.workdir }} && go mod tidy)
- name: Run git diff
run: git diff --exit-code
go_generate:
runs-on: ubuntu-latest
container:
image: cubicrootxyz/golang-ci:v1.23.3
options: --user root
steps:
- uses: actions/checkout@v4
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Install mockgen
run: go install github.com/golang/mock/[email protected]
- name: Run go generate
run: go generate ${{ inputs.workdir }}...
- name: Run git diff
run: git diff --exit-code