Skip to content

Commit c3c454e

Browse files
committed
(maint) Update github actions
1 parent 1be9c63 commit c3c454e

File tree

7 files changed

+139
-208
lines changed

7 files changed

+139
-208
lines changed

.github/workflows/nightly.yml

Lines changed: 25 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -18,45 +18,41 @@ jobs:
1818

1919
steps:
2020
- name: "Honeycomb: Start recording"
21-
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2
21+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
2222
with:
2323
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
2424
dataset: ${{ env.HONEYCOMB_DATASET }}
2525
job-status: ${{ job.status }}
2626

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

3636
- name: Activate Ruby 2.7
37-
uses: actions/setup-ruby@v1
37+
uses: ruby/setup-ruby@v1
3838
if: ${{ github.repository_owner == 'puppetlabs' }}
3939
with:
4040
ruby-version: "2.7"
41+
bundler-cache: true
4142

42-
- name: Cache gems
43-
uses: actions/cache@v2
43+
- name: Print bundle environment
4444
if: ${{ github.repository_owner == 'puppetlabs' }}
45-
with:
46-
path: vendor/gems
47-
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
48-
restore-keys: |
49-
${{ runner.os }}-${{ github.event_name }}-
50-
${{ runner.os }}-
45+
run: |
46+
echo ::group::bundler environment
47+
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
48+
echo ::endgroup::
5149
52-
- name: Install gems
50+
- name: "Honeycomb: Record Setup Environment time"
5351
if: ${{ github.repository_owner == 'puppetlabs' }}
5452
run: |
55-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
56-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
57-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
58-
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
59-
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
53+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
54+
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
55+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
6056
6157
- name: Setup Acceptance Test Matrix
6258
id: get-matrix
@@ -68,7 +64,7 @@ jobs:
6864
echo "::set-output name=matrix::{}"
6965
fi
7066
71-
- name: "Honeycomb: Record setup time"
67+
- name: "Honeycomb: Record Setup Test Matrix time"
7268
if: ${{ always() }}
7369
run: |
7470
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
@@ -91,7 +87,7 @@ jobs:
9187
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
9288
9389
- name: "Honeycomb: Start recording"
94-
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2
90+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
9591
with:
9692
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
9793
dataset: ${{ env.HONEYCOMB_DATASET }}
@@ -107,42 +103,22 @@ jobs:
107103
uses: actions/checkout@v2
108104

109105
- name: Activate Ruby 2.7
110-
uses: actions/setup-ruby@v1
106+
uses: ruby/setup-ruby@v1
111107
with:
112108
ruby-version: "2.7"
109+
bundler-cache: true
113110

114-
- name: Cache gems
115-
uses: actions/cache@v2
116-
with:
117-
path: vendor/gems
118-
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
119-
restore-keys: |
120-
${{ runner.os }}-${{ github.event_name }}-
121-
${{ runner.os }}-
122-
123-
- name: "Honeycomb: Record cache setup time"
124-
if: ${{ always() }}
111+
- name: Print bundle environment
125112
run: |
126-
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval'
127-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
128-
echo STEP_START=$(date +%s) >> $GITHUB_ENV
129-
130-
- name: Bundler Setup
131-
run: |
132-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
133-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
134-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
135-
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
136-
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
137113
echo ::group::bundler environment
138114
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
139115
echo ::endgroup::
140116
141-
- name: "Honeycomb: Record Bundler Setup time"
117+
- name: "Honeycomb: Record Setup Environment time"
142118
if: ${{ always() }}
143119
run: |
144-
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
145-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
120+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
121+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
146122
echo STEP_START=$(date +%s) >> $GITHUB_ENV
147123
148124
- name: Provision test environment
@@ -169,7 +145,7 @@ jobs:
169145
run: |
170146
echo ::group::honeycomb step
171147
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
172-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
148+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
173149
echo STEP_START=$(date +%s) >> $GITHUB_ENV
174150
echo ::endgroup::
175151
@@ -181,11 +157,12 @@ jobs:
181157
if: ${{ always() }}
182158
run: |
183159
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
184-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV
160+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
185161
echo STEP_START=$(date +%s) >> $GITHUB_ENV
186162
187163
- name: Remove test environment
188164
if: ${{ always() }}
165+
continue-on-error: true
189166
run: |
190167
if [ -f inventory.yaml ]; then
191168
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
@@ -200,18 +177,6 @@ jobs:
200177
run: |
201178
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'
202179
203-
promoteService:
204-
if: ${{ success() }}
205-
name: "Promote provision service"
206-
runs-on: ubuntu-latest
207-
steps:
208-
- name: "Repository dispatch"
209-
uses: peter-evans/repository-dispatch@ce5485de42c9b2622d2ed064be479e8ed65e76f4 # pin@v1
210-
with:
211-
token: ${{ secrets.REPO_DISPATCH }}
212-
repository: puppetlabs/provision_service
213-
event-type: promote
214-
215180
slack-workflow-status:
216181
if: always()
217182
name: Post Workflow Status To Slack
@@ -220,7 +185,7 @@ jobs:
220185
runs-on: ubuntu-20.04
221186
steps:
222187
- name: Slack Workflow Notification
223-
uses: Gamesight/slack-workflow-status@88ee95b73b4669825883ddf22747966204663e58 # pin@master
188+
uses: puppetlabs/Gamesight-slack-workflow-status@pdk-templates-v1
224189
with:
225190
# Required Input
226191
repo_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr_test.yml

Lines changed: 25 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -16,64 +16,60 @@ jobs:
1616

1717
steps:
1818
- name: "Honeycomb: Start recording"
19-
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2
19+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
2020
with:
2121
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
2222
dataset: ${{ env.HONEYCOMB_DATASET }}
2323
job-status: ${{ job.status }}
2424

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

3434
- name: Activate Ruby 2.7
35-
uses: actions/setup-ruby@v1
35+
uses: ruby/setup-ruby@v1
3636
if: ${{ github.repository_owner == 'puppetlabs' }}
3737
with:
3838
ruby-version: "2.7"
39+
bundler-cache: true
3940

40-
- name: Cache gems
41-
uses: actions/cache@v2
41+
- name: Print bundle environment
4242
if: ${{ github.repository_owner == 'puppetlabs' }}
43-
with:
44-
path: vendor/gems
45-
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
46-
restore-keys: |
47-
${{ runner.os }}-${{ github.event_name }}-
48-
${{ runner.os }}-
43+
run: |
44+
echo ::group::bundler environment
45+
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
46+
echo ::endgroup::
4947
50-
- name: Install gems
48+
- name: "Honeycomb: Record Setup Environment time"
5149
if: ${{ github.repository_owner == 'puppetlabs' }}
5250
run: |
53-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
54-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
55-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
56-
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
57-
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
51+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
52+
echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV
53+
echo STEP_START=$(date +%s) >> $GITHUB_ENV
5854
5955
- name: Setup Acceptance Test Matrix
6056
id: get-matrix
61-
if: ${{ github.repository_owner == 'puppetlabs' }}
6257
run: |
6358
if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
6459
buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata
6560
else
6661
echo "::set-output name=matrix::{}"
6762
fi
6863
69-
- name: "Honeycomb: Record setup time"
64+
- name: "Honeycomb: Record Setup Test Matrix time"
7065
if: ${{ always() }}
7166
run: |
7267
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
7368
7469
Acceptance:
7570
needs:
7671
- setup_matrix
72+
if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}
7773

7874
runs-on: ubuntu-20.04
7975
strategy:
@@ -89,7 +85,7 @@ jobs:
8985
echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
9086
9187
- name: "Honeycomb: Start recording"
92-
uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2
88+
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
9389
with:
9490
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
9591
dataset: ${{ env.HONEYCOMB_DATASET }}
@@ -105,42 +101,22 @@ jobs:
105101
uses: actions/checkout@v2
106102

107103
- name: Activate Ruby 2.7
108-
uses: actions/setup-ruby@v1
104+
uses: ruby/setup-ruby@v1
109105
with:
110106
ruby-version: "2.7"
107+
bundler-cache: true
111108

112-
- name: Cache gems
113-
uses: actions/cache@v2
114-
with:
115-
path: vendor/gems
116-
key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
117-
restore-keys: |
118-
${{ runner.os }}-${{ github.event_name }}-
119-
${{ runner.os }}-
120-
121-
- name: "Honeycomb: Record cache setup time"
122-
if: ${{ always() }}
109+
- name: Print bundle environment
123110
run: |
124-
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval'
125-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
126-
echo STEP_START=$(date +%s) >> $GITHUB_ENV
127-
128-
- name: Bundler Setup
129-
run: |
130-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems
131-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8
132-
buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3
133-
buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install
134-
buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean
135111
echo ::group::bundler environment
136112
buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
137113
echo ::endgroup::
138114
139-
- name: "Honeycomb: Record Bundler Setup time"
115+
- name: "Honeycomb: Record Setup Environment time"
140116
if: ${{ always() }}
141117
run: |
142-
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
143-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
118+
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
119+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
144120
echo STEP_START=$(date +%s) >> $GITHUB_ENV
145121
146122
- name: Provision test environment
@@ -167,7 +143,7 @@ jobs:
167143
run: |
168144
echo ::group::honeycomb step
169145
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
170-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
146+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
171147
echo STEP_START=$(date +%s) >> $GITHUB_ENV
172148
echo ::endgroup::
173149
@@ -179,11 +155,12 @@ jobs:
179155
if: ${{ always() }}
180156
run: |
181157
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
182-
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV
158+
echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
183159
echo STEP_START=$(date +%s) >> $GITHUB_ENV
184160
185161
- name: Remove test environment
186162
if: ${{ always() }}
163+
continue-on-error: true
187164
run: |
188165
if [ -f inventory.yaml ]; then
189166
buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'

0 commit comments

Comments
 (0)