-
Notifications
You must be signed in to change notification settings - Fork 69
164 lines (131 loc) · 3.92 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
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: Lint
on:
push:
branches:
- main
- v1.0.0
pull_request:
types:
- unlocked
jobs:
typos-check:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v3
- name: Check spelling with custom config file
uses: crate-ci/typos@v1.13.14
with:
config: ./typos.toml
diff:
runs-on: ubuntu-latest
outputs:
golang: ${{ steps.filter.outputs.golang }}
js: ${{ steps.filter.outputs.js }}
helmcharts: ${{ steps.filter.outputs.helmcharts }}
docs: ${{ steps.filter.outputs.docs }}
steps:
- uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: filter
with:
base: main
filters: |
golang:
- "api-server/**"
- "common/**"
- "schemas/**"
js:
- "dashboard/**"
helmcharts:
- "helm/**"
docs:
- requirements/docs-requirements.txt
- "docs/**"
eslint:
runs-on: ubuntu-latest
needs:
- diff
if: ${{ (github.event_name == 'pull_request' && needs.diff.outputs.js == 'true') || github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v2
with:
path: '**/dashboard/node_modules'
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/dashboard/yarn.lock') }}
- name: Install packages
run: cd dashboard; yarn
- name: Run eslint
run: cd dashboard; yarn lint
golint:
runs-on: ubuntu-latest
needs:
- diff
if: ${{ (github.event_name == 'pull_request' && needs.diff.outputs.golang == 'true') || github.event_name == 'push' }}
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.20' # The Go version to download (if necessary) and use.
- uses: actions/checkout@v3
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: 'v1.52.2'
helmchartslint:
runs-on: ubuntu-latest
needs:
- diff
if: ${{ (github.event_name == 'pull_request' && needs.diff.outputs.helmcharts == 'true') || github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.8.1
- name: Set up chart-testing
uses: helm/chart-testing-action@v2.2.1
- name: Run chart-testing (lint)
working-directory: ./helm/yatai
run: make lint
- name: Render Helm Template
working-directory: ./helm/yatai
run: make template
docslint:
defaults:
run:
shell: bash
runs-on: ubuntu-latest
needs:
- diff
if: ${{ (github.event_name == 'pull_request' && needs.diff.outputs.docs == 'true') || github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch all tags and branches
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Get pip cache dir
id: cache-dir
run: |
echo ::set-output name=dir::$(pip cache dir)
- name: Cache pip dependencies
uses: actions/cache@v3
id: cache-pip
with:
path: ${{ steps.cache-dir.outputs.dir }}
key: ${{ runner.os }}-docs-${{ hashFiles('requirements/docs-requirements.txt') }}
- name: Install dependencies
run: |
pip install -r requirements/docs-requirements.txt
- name: Install libenchant
run: |
sudo apt-get update && sudo apt-get install -y libenchant-2-dev
- name: Run spellcheck script
run: make spellcheck-docs
shell: bash
- name: Run linkcheck script
run: make linkcheck-docs
shell: bash