forked from k0sproject/k0s
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (79 loc) · 2 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Go lint
on:
push:
branches:
- main
- release-*
paths-ignore:
- 'docs/**'
- 'examples/**'
- '**.md'
- LICENSE
- '**.svg'
- '.github/workflows/docs.yml'
- '.github/workflows/mkdocs-set-default-version.yml'
- 'mkdocs.yml'
pull_request:
branches:
- main
- release-*
paths-ignore:
- 'docs/**'
- 'examples/**'
- '**.md'
- LICENSE
- README.md
- '**.svg'
- '.github/workflows/docs.yml'
- '.github/workflows/mkdocs-set-default-version.yml'
- 'mkdocs.yml'
- '*.md'
env:
MAKEFLAGS: -j
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Go caches
uses: actions/cache@v4
with:
key: ${{ runner.os }}-lint-go-caches-${{ hashFiles('go.sum') }}
path: |
build/cache
~/go/pkg/mod
~/.cache/go-build
~/.cache/golangci-lint
- name: Check go.mod/go.sum to be consistent
run: make --always-make go.sum && git diff --exit-code
- name: Check generated code to be consistent
run: make codegen EMBEDDED_BINS_BUILDMODE=none && git diff --exit-code
- name: Run linter
env:
EMBEDDED_BINS_BUILDMODE: none
GOLANGCI_LINT_FLAGS: --out-format=github-actions
run: |
make lint
validate-os-tests:
name: Validate OS tests
runs-on: ubuntu-22.04
env:
TERRAFORM_VERSION: 1.4.6
defaults:
run:
working-directory: hack/ostests
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: hack/ostests
persist-credentials: false
- uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TERRAFORM_VERSION }}
terraform_wrapper: false
- run: terraform fmt -check
- run: terraform init
- run: terraform validate -no-color