-
Notifications
You must be signed in to change notification settings - Fork 107
141 lines (128 loc) · 3.9 KB
/
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Linting
on:
pull_request:
jobs:
golangci:
name: Lint golang files
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
cache: false
- name: golangci-lint
uses: golangci/[email protected]
with:
only-new-issues: true
version: v1.60.3
args: --timeout=900s
gomodtidy:
name: Enforce go.mod tidiness
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Execute go mod tidy and check the outcome
working-directory: ./
run: |
go mod tidy
exit_code=$(git diff --exit-code)
exit ${exit_code}
- name: Issue a comment in case the of failure
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.CI_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: |
The `go.mod` and/or `go.sum` files appear not to be correctly tidied.
Please, rerun `go mod tidy` to fix the issues.
reactions: confused
if: |
failure() && github.event.pull_request.head.repo.full_name == github.repository
shelllint:
name: Lint bash files
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- name: Run Shellcheck
uses: ludeeus/[email protected]
env:
# Allow 'source' outside of FILES
SHELLCHECK_OPTS: -x
markdownlint:
name: Lint markdown files
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- name: Lint markdown files
uses: avto-dev/markdown-lint@v1
with:
config: '.markdownlint.yml'
args: '**/*.md'
ignore: .github/ISSUE_TEMPLATE/*.md
doclint:
name: Lint documentation files
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- name: Setup python3
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install python3 dependencies
working-directory: ./docs
run: |
pip3 install -r requirements.txt
- name: Build documentation
working-directory: ./docs
run: |
make dummy
- name: Check external links
working-directory: ./docs
run: |
make linkcheck
helmlint:
name: Lint helm chart
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
repository: ${{github.event.pull_request.head.repo.full_name}}
persist-credentials: false
- name: Verify that the helm chart is well-formed
uses: WyriHaximus/github-action-helm3@v4
with:
exec:
helm lint ./deployments/liqo --with-subcharts --set tag=fakeversion