-
Notifications
You must be signed in to change notification settings - Fork 15
487 lines (467 loc) · 13.4 KB
/
tests.yaml
File metadata and controls
487 lines (467 loc) · 13.4 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
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
---
name: Tests
on:
pull_request: {}
push:
branches:
- main
permissions:
contents: read
# those variables are used by the majority of jobs and we don't want to repeat them in each job
env:
BOLT_WINRM_USER: roddypiper
BOLT_WINRM_HOST: localhost
BOLT_WINRM_PORT: 5985
BOLT_WINRM_SSL_PORT: 5986
BOLT_WINRM_SMB_PORT: 445
jobs:
rubocop_and_matrix:
runs-on: ubuntu-24.04
outputs:
ruby: ${{ steps.ruby.outputs.versions }}
steps:
- uses: actions/checkout@v6
- name: Install Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Run Rubocop
run: bundle exec rake rubocop
- id: ruby
uses: voxpupuli/ruby-version@v1
cache_modules_linux:
name: 'Linux: Generate module cache'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- name: Install modules
if: steps.modules.outputs.cache-hit != 'true'
run: bundle exec r10k puppetfile install
- name: list modules
run: bundle exec puppet module list --modulepath=modules/
cache_modules_windows:
name: 'Windows: Generate module cache'
runs-on: 'windows-2025'
steps:
- uses: actions/checkout@v6
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- name: Install modules
if: steps.modules.outputs.cache-hit != 'true'
run: bundle exec r10k puppetfile install
- name: list modules
run: bundle exec puppet module list --modulepath=modules/
unit:
needs:
- rubocop_and_matrix
- cache_modules_linux
- cache_modules_windows
name: "Unit tests ${{ matrix.ruby }} ${{ matrix.os }}"
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2025]
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Output Ruby Environment
run: bundle env
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- name: Unit tests
run: bundle exec rake tests:unit
run-dita:
runs-on: ubuntu-24.04
steps:
- name: Initialize
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Generate docs
run: bundle exec rake docs:all
- name: Docs test
uses: dita-ot/dita-ot-action@4.3.5
with:
build: dita -i documentation/bolt.ditamap -o out -f html5 --processing-mode=strict
local_transports:
name: "local transport ${{ matrix.ruby }} ${{ matrix.os }}"
needs:
- rubocop_and_matrix
- cache_modules_linux
- cache_modules_windows
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2025]
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- if: runner.os == 'Linux'
uses: ./.github/actions/sudo_setup
- if: runner.os == 'Windows'
uses: ./.github/actions/windows_agent_setup
- if: runner.os == 'Linux'
name: Run tests
run: bundle exec rake ci:local_transport:linux
- if: runner.os == 'Windows'
name: Run tests
run: bundle exec rake ci:local_transport:windows
winrm_transport:
needs:
- rubocop_and_matrix
- cache_modules_windows
name: WinRM Transport
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- name: Configure WinRM and use Puppet's Ruby
shell: powershell
run: |
. scripts\ci.ps1
Set-ActiveRubyFromPuppet
- name: WinRM transport tests
run: bundle exec rake ci:winrm_transport
apply:
name: bolt apply
needs:
- rubocop_and_matrix
- cache_modules_linux
- cache_modules_windows
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2025]
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- if: runner.os == 'Linux'
uses: ./.github/actions/sudo_setup
- if: runner.os == 'Windows'
uses: ./.github/actions/windows_agent_setup
- if: runner.os == 'Linux'
name: Run tests
run: bundle exec rake ci:apply:linux
- name: Show tasks
run: bundle exec bolt task show
- if: runner.os == 'Windows'
name: Run tests
run: bundle exec rake ci:apply:windows
boltspec:
name: BoltSpec
needs:
- rubocop_and_matrix
- cache_modules_windows
- cache_modules_linux
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2025]
# currently fails on Ruby 3.4
#ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
ruby: ['3.2', '3.3']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- if: runner.os == 'Linux'
uses: ./.github/actions/docker_setup
- if: runner.os == 'Windows'
uses: ./.github/actions/windows_agentless_setup
- name: Run tests
if: runner.os == 'Windows'
run: bundle exec rake ci:boltspec:windows
- name: Run tests
if: runner.os == 'Linux'
run: bundle exec rake ci:boltspec:linux
check_dependencies:
name: Check mod deps
needs:
- cache_modules_linux
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- name: Validate all module dependencies
run: bundle exec ./scripts/check_dependencies.rb
integration_windows:
needs:
- rubocop_and_matrix
- cache_modules_windows
name: Windows Integration
runs-on: windows-2025
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
env:
WINDOWS_AGENTS: true
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- uses: ./.github/actions/windows_agent_setup
- name: Run tests
run: bundle exec rake ci:windows:integration
agentless:
needs:
- rubocop_and_matrix
- cache_modules_windows
name: Windows Agentless
runs-on: windows-2025
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
env:
BOLT_WINDOWS: true
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- uses: ./.github/actions/windows_agentless_setup
- name: Run tests
run: bundle exec rake ci:windows:agentless
ssh_transport:
needs:
- rubocop_and_matrix
- cache_modules_linux
name: SSH Transport
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
ruby: ['3.2', '3.3']
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- uses: ./.github/actions/sudo_setup
- name: Run tests
run: bundle exec rake ci:ssh_transport
docker_transport:
needs:
- rubocop_and_matrix
- cache_modules_linux
name: Docker Transport
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- uses: ./.github/actions/sudo_setup
- name: Run tests
run: bundle exec rake ci:docker_transport
integration_linux:
needs:
- rubocop_and_matrix
- cache_modules_linux
name: Linux Integration
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v5
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- uses: ./.github/actions/sudo_setup
- name: Run tests
run: bundle exec rake ci:linux:integration
modules_ci:
name: Test vendored Modules - ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
strategy:
matrix:
runs-on:
- ubuntu-24.04
- windows-2025
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
- name: Run module tests
run: bundle exec rake ci:modules
tests:
if: always()
needs:
- rubocop_and_matrix
- cache_modules_linux
- cache_modules_windows
- unit
- run-dita
- local_transports
- winrm_transport
- apply
- boltspec
- check_dependencies
- integration_windows
- agentless
- ssh_transport
- docker_transport
- integration_linux
- modules_ci
runs-on: ubuntu-24.04
name: Test suite
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}