-
Notifications
You must be signed in to change notification settings - Fork 15
187 lines (178 loc) · 4.97 KB
/
tests.yaml
File metadata and controls
187 lines (178 loc) · 4.97 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
---
name: Tests
on:
pull_request: {}
push:
branches:
- main
permissions:
contents: read
jobs:
rubocop_and_matrix:
runs-on: ubuntu-24.04
outputs:
ruby: ${{ steps.ruby.outputs.versions }}
steps:
- uses: actions/checkout@v5
- 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:
runs-on: ubuntu-24.04
name: 'Run r10k and update module cache'
steps:
- uses: actions/checkout@v5
- name: Install Ruby ${{ matrix.ruby }}
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v4
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
unit:
needs:
- rubocop_and_matrix
- cache_modules
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@v5
- 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@v4
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@v5
- 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.1.2
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
env:
BOLT_WINRM_USER: roddypiper
BOLT_WINRM_HOST: localhost
BOLT_WINRM_PORT: 5985
BOLT_WINRM_SSL_PORT: 5986
BOLT_WINRM_SMB_PORT: 445
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@v5
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v4
with:
path: modules
key: ${{ runner.os }}-modules-${{ hashFiles('**/Puppetfile') }}
- if: matrix.os == 'ubuntu-24.04'
uses: ./.github/actions/sudo_setup
- if: matrix.os == 'windows-2025'
uses: ./.github/actions/windows_agent_setup
- if: matrix.os == 'ubuntu-24.04'
name: Run tests
run: bundle exec rake ci:local_transport:linux
- if: matrix.os == 'windows-2025'
name: Run tests
run: bundle exec rake ci:local_transport:windows
winrm_transport:
needs:
- rubocop_and_matrix
- cache_modules
env:
BOLT_WINRM_USER: roddypiper
BOLT_WINRM_HOST: localhost
BOLT_WINRM_PORT: 5985
BOLT_WINRM_SSL_PORT: 5986
BOLT_WINRM_SMB_PORT: 445
name: WinRM Transport
runs-on: windows-latest
strategy:
matrix:
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Cache modules
id: modules
uses: actions/cache@v4
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
tests:
needs:
- rubocop_and_matrix
- cache_modules
- unit
- run-dita
- local_transports
- winrm_transport
runs-on: ubuntu-24.04
name: Test suite
steps:
- run: echo Test suite complete