Skip to content

Commit 380c0a4

Browse files
author
Ciaran McCrisken
committed
(MAINT) pdk update
1 parent 9433536 commit 380c0a4

File tree

7 files changed

+92
-164
lines changed

7 files changed

+92
-164
lines changed

.github/workflows/nightly.yml

Lines changed: 33 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -17,62 +17,59 @@ jobs:
1717

1818
steps:
1919
- name: "Honeycomb: Start recording"
20-
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # [email protected]
20+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
2121
with:
2222
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
2323
dataset: ${{ env.HONEYCOMB_DATASET }}
2424
job-status: ${{ job.status }}
2525

2626
- name: "Honeycomb: Start first step"
2727
run: |
28-
echo STEP_ID=0 >> $GITHUB_ENV
28+
echo STEP_ID=setup-environment >> $GITHUB_ENV
2929
echo STEP_START=$(date +%s) >> $GITHUB_ENV
3030
3131
- name: Checkout Source
3232
uses: actions/checkout@v2
3333
if: ${{ github.repository_owner == 'puppetlabs' }}
3434

3535
- name: Activate Ruby 2.7
36-
uses: actions/setup-ruby@v1
36+
uses: ruby/setup-ruby@v1
3737
if: ${{ github.repository_owner == 'puppetlabs' }}
3838
with:
3939
ruby-version: "2.7"
40+
bundler-cache: true
4041

41-
- name: Cache gems
42-
uses: actions/cache@v2
42+
- name: Print bundle environment
4343
if: ${{ github.repository_owner == 'puppetlabs' }}
44-
with:
45-
path: vendor/gems
46-
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
47-
restore-keys: |
48-
${{ runner.os }}-${{ github.event_name }}-
49-
${{ runner.os }}-
44+
run: |
45+
echo ::group::bundler environment
46+
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
47+
echo ::endgroup::
5048
51-
- name: Install gems
49+
- name: "Honeycomb: Record Setup Environment time"
5250
if: ${{ github.repository_owner == 'puppetlabs' }}
5351
run: |
54-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
55-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
56-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
57-
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
58-
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
52+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
53+
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
54+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
5955
6056
- name: Setup Acceptance Test Matrix
6157
id: get-matrix
6258
if: ${{ github.repository_owner == 'puppetlabs' }}
6359
run: |
6460
if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
65-
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata
61+
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2
6662
else
6763
echo "::set-output name=matrix::{}"
6864
fi
6965
70-
- name: "Honeycomb: Record setup time"
66+
- name: "Honeycomb: Record Setup Test Matrix time"
7167
if: ${{ always() }}
7268
run: |
7369
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
7470
7571
Acceptance:
72+
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
7673
needs:
7774
- setup_matrix
7875

@@ -86,67 +83,49 @@ jobs:
8683

8784
steps:
8885
- run: |
89-
echo 'platform=${{ matrix.platform }}' >> $BUILDEVENT_FILE
86+
echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE
9087
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
88+
echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE
89+
9190
9291
- name: "Honeycomb: Start recording"
93-
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # [email protected]
92+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
9493
with:
9594
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
9695
dataset: ${{ env.HONEYCOMB_DATASET }}
9796
job-status: ${{ job.status }}
98-
matrix-key: ${{ matrix.platform }}-${{ matrix.collection }}
97+
matrix-key: ${{ matrix.platforms.label }}-${{ matrix.collection }}
9998

10099
- name: "Honeycomb: start first step"
101100
run: |
102-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
101+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
103102
echo STEP_START=$(date +%s) >> $GITHUB_ENV
104103
105104
- name: Checkout Source
106105
uses: actions/checkout@v2
107106

108107
- name: Activate Ruby 2.7
109-
uses: actions/setup-ruby@v1
108+
uses: ruby/setup-ruby@v1
110109
with:
111110
ruby-version: "2.7"
111+
bundler-cache: true
112112

113-
- name: Cache gems
114-
uses: actions/cache@v2
115-
with:
116-
path: vendor/gems
117-
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
118-
restore-keys: |
119-
${{ runner.os }}-${{ github.event_name }}-
120-
${{ runner.os }}-
121-
122-
- name: "Honeycomb: Record cache setup time"
123-
if: ${{ always() }}
124-
run: |
125-
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval'
126-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
127-
echo STEP_START=$(date +%s) >> $GITHUB_ENV
128-
129-
- name: Bundler Setup
113+
- name: Print bundle environment
130114
run: |
131-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
132-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
133-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
134-
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
135-
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
136115
echo ::group::bundler environment
137116
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
138117
echo ::endgroup::
139118
140-
- name: "Honeycomb: Record Bundler Setup time"
119+
- name: "Honeycomb: Record Setup Environment time"
141120
if: ${{ always() }}
142121
run: |
143-
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
144-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
122+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
123+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
145124
echo STEP_START=$(date +%s) >> $GITHUB_ENV
146125
147126
- name: Provision test environment
148127
run: |
149-
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platform }}' -- bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]'
128+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
150129
echo ::group::=== REQUEST ===
151130
cat request.json || true
152131
echo
@@ -168,7 +147,7 @@ jobs:
168147
run: |
169148
echo ::group::honeycomb step
170149
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
171-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
150+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
172151
echo STEP_START=$(date +%s) >> $GITHUB_ENV
173152
echo ::endgroup::
174153
@@ -180,11 +159,12 @@ jobs:
180159
if: ${{ always() }}
181160
run: |
182161
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
183-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV
162+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
184163
echo STEP_START=$(date +%s) >> $GITHUB_ENV
185164
186165
- name: Remove test environment
187166
if: ${{ always() }}
167+
continue-on-error: true
188168
run: |
189169
if [ -f inventory.yaml ]; then
190170
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
@@ -207,7 +187,7 @@ jobs:
207187
runs-on: ubuntu-20.04
208188
steps:
209189
- name: Slack Workflow Notification
210-
uses: Gamesight/slack-workflow-status@88ee95b73b4669825883ddf22747966204663e58 # pin@master
190+
uses: puppetlabs/Gamesight-slack-workflow-status@pdk-templates-v1
211191
with:
212192
# Required Input
213193
repo_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr_test.yml

Lines changed: 32 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -15,64 +15,61 @@ jobs:
1515

1616
steps:
1717
- name: "Honeycomb: Start recording"
18-
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # [email protected]
18+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
1919
with:
2020
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
2121
dataset: ${{ env.HONEYCOMB_DATASET }}
2222
job-status: ${{ job.status }}
2323

2424
- name: "Honeycomb: Start first step"
2525
run: |
26-
echo STEP_ID=0 >> $GITHUB_ENV
26+
echo STEP_ID=setup-environment >> $GITHUB_ENV
2727
echo STEP_START=$(date +%s) >> $GITHUB_ENV
2828
2929
- name: Checkout Source
3030
uses: actions/checkout@v2
3131
if: ${{ github.repository_owner == 'puppetlabs' }}
3232

3333
- name: Activate Ruby 2.7
34-
uses: actions/setup-ruby@v1
34+
uses: ruby/setup-ruby@v1
3535
if: ${{ github.repository_owner == 'puppetlabs' }}
3636
with:
3737
ruby-version: "2.7"
38+
bundler-cache: true
3839

39-
- name: Cache gems
40-
uses: actions/cache@v2
40+
- name: Print bundle environment
4141
if: ${{ github.repository_owner == 'puppetlabs' }}
42-
with:
43-
path: vendor/gems
44-
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
45-
restore-keys: |
46-
${{ runner.os }}-${{ github.event_name }}-
47-
${{ runner.os }}-
42+
run: |
43+
echo ::group::bundler environment
44+
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
45+
echo ::endgroup::
4846
49-
- name: Install gems
47+
- name: "Honeycomb: Record Setup Environment time"
5048
if: ${{ github.repository_owner == 'puppetlabs' }}
5149
run: |
52-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
53-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
54-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
55-
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
56-
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
50+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
51+
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
52+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
5753
5854
- name: Setup Acceptance Test Matrix
5955
id: get-matrix
60-
if: ${{ github.repository_owner == 'puppetlabs' }}
6156
run: |
6257
if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
63-
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata
58+
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2
6459
else
6560
echo "::set-output name=matrix::{}"
6661
fi
6762
68-
- name: "Honeycomb: Record setup time"
63+
- name: "Honeycomb: Record Setup Test Matrix time"
6964
if: ${{ always() }}
7065
run: |
7166
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
7267
7368
Acceptance:
69+
name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
7470
needs:
7571
- setup_matrix
72+
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}
7673

7774
runs-on: ubuntu-20.04
7875
strategy:
@@ -84,67 +81,48 @@ jobs:
8481

8582
steps:
8683
- run: |
87-
echo 'platform=${{ matrix.platform }}' >> $BUILDEVENT_FILE
84+
echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE
8885
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
86+
echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE
8987
9088
- name: "Honeycomb: Start recording"
91-
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # [email protected]
89+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
9290
with:
9391
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
9492
dataset: ${{ env.HONEYCOMB_DATASET }}
9593
job-status: ${{ job.status }}
96-
matrix-key: ${{ matrix.platform }}-${{ matrix.collection }}
94+
matrix-key: ${{ matrix.platforms.label }}-${{ matrix.collection }}
9795

9896
- name: "Honeycomb: start first step"
9997
run: |
100-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
98+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
10199
echo STEP_START=$(date +%s) >> $GITHUB_ENV
102100
103101
- name: Checkout Source
104102
uses: actions/checkout@v2
105103

106104
- name: Activate Ruby 2.7
107-
uses: actions/setup-ruby@v1
105+
uses: ruby/setup-ruby@v1
108106
with:
109107
ruby-version: "2.7"
108+
bundler-cache: true
110109

111-
- name: Cache gems
112-
uses: actions/cache@v2
113-
with:
114-
path: vendor/gems
115-
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
116-
restore-keys: |
117-
${{ runner.os }}-${{ github.event_name }}-
118-
${{ runner.os }}-
119-
120-
- name: "Honeycomb: Record cache setup time"
121-
if: ${{ always() }}
122-
run: |
123-
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval'
124-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
125-
echo STEP_START=$(date +%s) >> $GITHUB_ENV
126-
127-
- name: Bundler Setup
110+
- name: Print bundle environment
128111
run: |
129-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
130-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
131-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
132-
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
133-
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
134112
echo ::group::bundler environment
135113
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
136114
echo ::endgroup::
137115
138-
- name: "Honeycomb: Record Bundler Setup time"
116+
- name: "Honeycomb: Record Setup Environment time"
139117
if: ${{ always() }}
140118
run: |
141-
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
142-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
119+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
120+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
143121
echo STEP_START=$(date +%s) >> $GITHUB_ENV
144122
145123
- name: Provision test environment
146124
run: |
147-
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platform }}' -- bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]'
125+
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
148126
echo ::group::=== REQUEST ===
149127
cat request.json || true
150128
echo
@@ -166,7 +144,7 @@ jobs:
166144
run: |
167145
echo ::group::honeycomb step
168146
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
169-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
147+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
170148
echo STEP_START=$(date +%s) >> $GITHUB_ENV
171149
echo ::endgroup::
172150
@@ -178,11 +156,12 @@ jobs:
178156
if: ${{ always() }}
179157
run: |
180158
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
181-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV
159+
echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
182160
echo STEP_START=$(date +%s) >> $GITHUB_ENV
183161
184162
- name: Remove test environment
185163
if: ${{ always() }}
164+
continue-on-error: true
186165
run: |
187166
if [ -f inventory.yaml ]; then
188167
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'

.rubocop.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ RSpec/BeforeAfterAll:
3030
RSpec/HookArgument:
3131
Description: Prefer explicit :each argument, matching existing module's style
3232
EnforcedStyle: each
33+
RSpec/DescribeSymbol:
34+
Exclude:
35+
- spec/unit/facter/**/*.rb
3336
Style/BlockDelimiters:
3437
Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to
3538
be consistent then.
@@ -405,6 +408,8 @@ Style/ExponentialNotation:
405408
Enabled: false
406409
Style/FloatDivision:
407410
Enabled: false
411+
Style/FrozenStringLiteralComment:
412+
Enabled: false
408413
Style/GlobalStdStream:
409414
Enabled: false
410415
Style/HashAsLastArrayItem:

0 commit comments

Comments
 (0)