Skip to content

Commit df48cfd

Browse files
committed
(maint) Update github actions
1 parent 8ab173b commit df48cfd

File tree

6 files changed

+118
-183
lines changed

6 files changed

+118
-183
lines changed

.github/workflows/nightly.yml

+25-48
Original file line numberDiff line numberDiff line change
@@ -17,45 +17,41 @@ 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
@@ -67,7 +63,7 @@ jobs:
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'
@@ -90,7 +86,7 @@ jobs:
9086
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
9187
9288
- name: "Honeycomb: Start recording"
93-
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # [email protected]
89+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
9490
with:
9591
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
9692
dataset: ${{ env.HONEYCOMB_DATASET }}
@@ -106,42 +102,22 @@ jobs:
106102
uses: actions/checkout@v2
107103

108104
- name: Activate Ruby 2.7
109-
uses: actions/setup-ruby@v1
105+
uses: ruby/setup-ruby@v1
110106
with:
111107
ruby-version: "2.7"
108+
bundler-cache: true
112109

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
110+
- name: Print bundle environment
130111
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
136112
echo ::group::bundler environment
137113
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
138114
echo ::endgroup::
139115
140-
- name: "Honeycomb: Record Bundler Setup time"
116+
- name: "Honeycomb: Record Setup Environment time"
141117
if: ${{ always() }}
142118
run: |
143-
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
144-
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.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
145121
echo STEP_START=$(date +%s) >> $GITHUB_ENV
146122
147123
- name: Provision test environment
@@ -168,7 +144,7 @@ jobs:
168144
run: |
169145
echo ::group::honeycomb step
170146
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
171-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
147+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
172148
echo STEP_START=$(date +%s) >> $GITHUB_ENV
173149
echo ::endgroup::
174150
@@ -180,11 +156,12 @@ jobs:
180156
if: ${{ always() }}
181157
run: |
182158
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
183-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV
159+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
184160
echo STEP_START=$(date +%s) >> $GITHUB_ENV
185161
186162
- name: Remove test environment
187163
if: ${{ always() }}
164+
continue-on-error: true
188165
run: |
189166
if [ -f inventory.yaml ]; then
190167
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
@@ -207,7 +184,7 @@ jobs:
207184
runs-on: ubuntu-20.04
208185
steps:
209186
- name: Slack Workflow Notification
210-
uses: Gamesight/slack-workflow-status@88ee95b73b4669825883ddf22747966204663e58 # pin@master
187+
uses: puppetlabs/Gamesight-slack-workflow-status@pdk-templates-v1
211188
with:
212189
# Required Input
213190
repo_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr_test.yml

+25-48
Original file line numberDiff line numberDiff line change
@@ -15,64 +15,60 @@ 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
6358
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata
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:
7469
needs:
7570
- setup_matrix
71+
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}
7672

7773
runs-on: ubuntu-20.04
7874
strategy:
@@ -88,7 +84,7 @@ jobs:
8884
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
8985
9086
- name: "Honeycomb: Start recording"
91-
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # [email protected]
87+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
9288
with:
9389
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
9490
dataset: ${{ env.HONEYCOMB_DATASET }}
@@ -104,42 +100,22 @@ jobs:
104100
uses: actions/checkout@v2
105101

106102
- name: Activate Ruby 2.7
107-
uses: actions/setup-ruby@v1
103+
uses: ruby/setup-ruby@v1
108104
with:
109105
ruby-version: "2.7"
106+
bundler-cache: true
110107

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() }}
108+
- name: Print bundle environment
122109
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
128-
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
134110
echo ::group::bundler environment
135111
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
136112
echo ::endgroup::
137113
138-
- name: "Honeycomb: Record Bundler Setup time"
114+
- name: "Honeycomb: Record Setup Environment time"
139115
if: ${{ always() }}
140116
run: |
141-
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
142-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
117+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
118+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
143119
echo STEP_START=$(date +%s) >> $GITHUB_ENV
144120
145121
- name: Provision test environment
@@ -166,7 +142,7 @@ jobs:
166142
run: |
167143
echo ::group::honeycomb step
168144
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
169-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
145+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
170146
echo STEP_START=$(date +%s) >> $GITHUB_ENV
171147
echo ::endgroup::
172148
@@ -178,11 +154,12 @@ jobs:
178154
if: ${{ always() }}
179155
run: |
180156
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
181-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV
157+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
182158
echo STEP_START=$(date +%s) >> $GITHUB_ENV
183159
184160
- name: Remove test environment
185161
if: ${{ always() }}
162+
continue-on-error: true
186163
run: |
187164
if [ -f inventory.yaml ]; then
188165
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'

0 commit comments

Comments
 (0)