-
Notifications
You must be signed in to change notification settings - Fork 57
76 lines (70 loc) · 2.26 KB
/
golangci-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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This document explains why this runs on GitHub over Circle
# https://www.notion.so/kurtosistech/Why-we-have-our-Linter-as-a-Github-Action-572b44c4a9b445009515b7b41d5f74ff
# we use `skip-pkg-cache:true` as we run into https://github.com/golangci/golangci-lint-action/issues/244 if we don't
name: Golang Lint
# We only want one run of this on a branch
# if you push another commit the previous run should cancel
concurrency:
group: "go-linter-${{ github.ref }}"
cancel-in-progress: true
permissions:
contents: read
on:
pull_request:
merge_group:
env:
GOLINT_VERSION: v1.53.3
jobs:
check-if-code-change:
runs-on: ubuntu-latest
outputs:
change: ${{ steps.check.outputs.change }}
steps:
- uses: actions/checkout@v4
with:
go-version: '1.20'
fetch-depth: 0
- run: |
if git --no-pager diff --exit-code origin/main...HEAD -- . ':!docs' ':!*.md'; then
echo "::set-output name=change::false"
else
echo "::set-output name=change::true"
fi
id: check
golangci:
needs: check-if-code-change
name: golang-lint
runs-on: ubuntu-latest
strategy:
matrix:
directory:
- container-engine-lib
- contexts-config-store
- grpc-file-transfer/golang
- metrics-library/golang
- name_generator
- api/golang
- core/server
- core/launcher
- engine/server
- engine/launcher
- internal_testsuites/golang
- cli/cli
steps:
- uses: actions/setup-go@v5
if: ${{ needs.check-if-code-change.outputs.change == 'true' }}
with:
go-version: '1.20'
- uses: actions/checkout@v4
if: ${{ needs.check-if-code-change.outputs.change == 'true' }}
# Generate versions
- run: scripts/generate-kurtosis-version.sh
if: ${{ needs.check-if-code-change.outputs.change == 'true' }}
- name: lint-container-engine-lib
if: ${{ needs.check-if-code-change.outputs.change == 'true' }}
uses: golangci/golangci-lint-action@v4
with:
version: ${{ env.GOLINT_VERSION }}
working-directory: ${{ matrix.directory }}
args: --timeout=3m
skip-pkg-cache: true