forked from kubernetes/minikube
-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (91 loc) · 3.01 KB
/
lint.yml
File metadata and controls
93 lines (91 loc) · 3.01 KB
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
92
name: Lint
on:
workflow_dispatch:
pull_request:
push:
branches: [ master ]
# Limit one unit test job running per PR/Branch
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
# For example, if you push multiple commits to a pull request in quick succession, only the latest workflow run will continue
cancel-in-progress: true
env:
GOPROXY: https://proxy.golang.org
GO_VERSION: '1.25.5'
permissions:
contents: read
jobs:
Lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
with:
go-version: ${{env.GO_VERSION}}
cache: true
- name: Download Dependencies
run: go mod download
# needed because pkg/drivers/kvm/domain.go:28:2:
- name: Install libvirt (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libvirt-dev
- name: Lint
timeout-minutes: 8
env:
TESTSUITE: lint
run: make test
continue-on-error: false
Boilerplate:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
with:
go-version: ${{env.GO_VERSION}}
cache: true
- name: Boilerplate check
timeout-minutes: 2
env:
TESTSUITE: boilerplate
run: make test
continue-on-error: false
Housekeeping:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5
with:
go-version: ${{env.GO_VERSION}}
cache: true
- name: Install goimports
run: go install golang.org/x/tools/cmd/goimports@latest
- name: Verify go mod tidy
run: |
make gomodtidy
if ! git diff-index --quiet HEAD; then
git --no-pager diff
echo "::notice::Please run 'make gomodtidy' and commit the changes"
exit 1
fi
- name: Verify make fmt
run: |
make fmt
if ! git diff-index --quiet HEAD; then
git --no-pager diff
echo "::notice::Please run 'make fmt' and commit the changes"
exit 1
fi
- name: Verify make imports
run: |
make imports
if ! git diff-index --quiet HEAD; then
git --no-pager diff
echo "::notice::Please run 'make imports' and commit the changes"
exit 1
fi
- name: Install markdownlint
run: npm install -g markdownlint-cli
- name: Verify make mdlint
run: make mdlint