blob: aafffe7216449267c38a9931fa8be9227449229c (
plain)
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
###############################################
# Test the website #
###############################################
#
# Test the links in the global nav for all MRs in `gitlab-docs`
#
test_global_nav_links:
image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-html:alpine-3.16-ruby-3.0.5-2a7e4d1c
extends:
- .rules_site_tests
- .bundle
stage: test
script:
# Only check files in top-level directories. This means a much faster and less repetitive check of global navigation links.
- echo " all:" >> nanoc.yaml
- echo " exclude_files:" >> nanoc.yaml
- echo " - '\/(ee|runner|omnibus|charts|operator)\/.*\/.*'" >> nanoc.yaml
- "parallel time bundle exec nanoc check ::: internal_links internal_anchors"
#
# Check the redirect file for duplicates
#
check_duplicate_redirects:
image: busybox
extends:
- .rules_site_tests
needs: []
stage: test
script:
- grep -Ir " - from:" content/_data/redirects.yaml | sort | uniq -d | tee output.txt
- exit $(cat output.txt | wc -l)
#
# Check global navigation for:
#
# - Identical duplicate entries.
# - index.html in the entries.
#
check_global_nav_entries:
extends:
- .rules_site_tests
needs: []
stage: test
script:
- make check-global-navigation
#
# Check that asdf dependencies install correctly
#
check_asdf_installation:
image: ubuntu:22.04
variables:
ASDF_VERSION: '0.11.1'
needs: []
stage: test
before_script:
- apt update
- apt install -y build-essential git curl zlib1g-dev libyaml-dev libssl-dev
script:
- git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v$ASDF_VERSION
- source "$HOME/.asdf/asdf.sh"
- make setup-asdf
- make install-asdf-dependencies
rules:
- if: '$DOCS_PROJECT_PIPELINE_TYPE =~ /^MR pipeline.*/'
changes:
- .tool-versions
#
# Run rspec tests
#
rspec:
extends:
- .rules_site_tests
- .bundle_and_yarn
needs: []
stage: test
script:
- make rspec-tests
coverage: '/\(\d+.\d+\%\) covered/'
artifacts:
reports:
coverage_report:
coverage_format: cobertura
path: coverage/coverage.xml
#
# Run JavaScript tests
#
jest:
extends:
- .rules_site_tests
- .yarn
needs: []
stage: test
script:
- make jest-tests
#
# Lint JavaScript
#
js_lint:
extends:
- .rules_site_tests
- .yarn
needs: []
stage: test
script:
- make eslint-tests
- make prettier-tests
#
# Lint SCSS
#
stylelint:
extends:
- .rules_site_tests
- .yarn
needs: []
stage: test
script:
- make stylelint-tests
#
# Yamllint of *.yml for .gitlab-ci.yml.
# This uses rules from project root `.yamllint`.
#
yamllint:
extends:
- .rules_site_tests
needs: []
stage: test
script:
- apk add yamllint
- make yamllint-tests
#
# Run markdownlint tests
#
markdownlint:
extends:
- .rules_site_tests
- .yarn
needs: []
stage: test
script:
- make markdownlint-tests
#
# Run ShellCheck tests
#
shellcheck:
extends:
- .rules_site_tests
image: koalaman/shellcheck-alpine:v0.9.0
needs: []
stage: test
script:
- apk add make
- make shellcheck-tests
#
# Check for broken external links
#
test_external_links:
extends:
- .bundle
- .rules_chores
stage: test
script:
- bundle exec nanoc check external_links
#
# Run markdownlint to find EOL whitespace to clean up
#
test_EOL_whitespace:
extends:
- .rules_chores
- .bundle
stage: test
image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-html:alpine-3.16-ruby-3.0.5-2a7e4d1c
needs: []
before_script: []
dependencies: []
script:
- apk add jq
- bundle config set --local deployment true # Install dependencies into ./vendor/ruby
- bundle install
- bundle exec rake default
- yarn global add markdownlint-cli2
- make markdownlint-whitespace-tests
test_unlinked_images:
extends:
- .rules_chores
- .bundle
stage: test
image: registry.gitlab.com/gitlab-org/gitlab-docs/lint-html:alpine-3.16-ruby-3.0.5-2a7e4d1c
needs: []
before_script: []
dependencies: []
script:
- apk add jq
- bundle config set --local deployment true # Install dependencies into ./vendor/ruby
- bundle install
- bundle exec rake default
- cp tasks/unlinked-images.sh ../gitlab/unlinked-images.sh
- cp tasks/unlinked-images.sh ../charts-gitlab/unlinked-images.sh
- cp tasks/unlinked-images.sh ../omnibus-gitlab/unlinked-images.sh
- cp tasks/unlinked-images.sh ../gitlab-runner/unlinked-images.sh
- cd ../omnibus-gitlab
- ./unlinked-images.sh doc
- cd ../charts-gitlab
- ./unlinked-images.sh doc
- cd ../gitlab-runner
- ./unlinked-images.sh docs
- cd ../gitlab
- ./unlinked-images.sh doc
lint_dockerfiles:
extends:
- .rules_site_tests
image: hadolint/hadolint:latest-alpine
needs: []
dependencies: []
script:
- apk add make
- make hadolint-tests
#
# eslint-sast scans html too, so run in security stage after html files are generated
#
eslint-sast:
stage: security
|