-
Notifications
You must be signed in to change notification settings - Fork 412
56 lines (44 loc) · 1.5 KB
/
lint.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
53
54
55
56
name: Lint
on:
pull_request:
branches:
- main
- v*
paths:
- "**.go"
- ".github/workflows/lint.yaml"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: ./go.mod
cache: false
- name: Generate Embedded Helm Chart
run: |
go generate ./...
- name: Verify schema changes
run: |
VALUES_SHA=$(cat chart/values.yaml | sha256sum)
VALUES_SCHEMA_SHA=$(cat chart/values.schema.json | sha256sum)
go run hack/schema/main.go
VALUES_SHA_AFTER=$(cat chart/values.yaml | sha256sum)
VALUES_SCHEMA_SHA_AFTER=$(cat chart/values.schema.json | sha256sum)
# if there are changes, tell developer to run script
if [ "$VALUES_SHA" != "$VALUES_SHA_AFTER" ] || [ "$VALUES_SCHEMA_SHA" != "$VALUES_SCHEMA_SHA_AFTER" ]; then
echo "Seems like you forgot to run 'go run hack/schema/main.go' before committing your changes!"
exit 1
fi
- name: Install golangci-lint
run: go install github.com/golangci/golangci-lint/cmd/[email protected]
- name: Build custom golangci-lint
run: golangci-lint custom
- name: Run golangci-lint
run: ./custom-gcl run