@@ -2,208 +2,20 @@ name: "nightly"
22
33on :
44 schedule :
5- - cron : ' 0 0 * * *'
6-
7- env :
8- HONEYCOMB_WRITEKEY : 7f3c63a70eecc61d635917de46bea4e6
9- HONEYCOMB_DATASET : litmus tests
5+ - cron : " 0 0 * * *"
6+ workflow_dispatch :
107
118jobs :
12- setup_matrix :
13- name : " Setup Test Matrix"
14- runs-on : ubuntu-20.04
15- outputs :
16- matrix : ${{ steps.get-matrix.outputs.matrix }}
17-
18- steps :
19- - name : " Honeycomb: Start recording"
20- uses : puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
21- with :
22- apikey : ${{ env.HONEYCOMB_WRITEKEY }}
23- dataset : ${{ env.HONEYCOMB_DATASET }}
24- job-status : ${{ job.status }}
25-
26- - name : " Honeycomb: Start first step"
27- run : |
28- echo STEP_ID=setup-environment >> $GITHUB_ENV
29- echo STEP_START=$(date +%s) >> $GITHUB_ENV
30-
31- - name : Checkout Source
32- uses : actions/checkout@v2
33- if : ${{ github.repository_owner == 'puppetlabs' }}
34-
35- - name : Activate Ruby 2.7
36- uses : ruby/setup-ruby@v1
37- if : ${{ github.repository_owner == 'puppetlabs' }}
38- with :
39- ruby-version : " 2.7"
40- bundler-cache : true
41-
42- - name : Print bundle environment
43- if : ${{ github.repository_owner == 'puppetlabs' }}
44- run : |
45- echo ::group::bundler environment
46- buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
47- echo ::endgroup::
48-
49- - name : " Honeycomb: Record Setup Environment time"
50- if : ${{ github.repository_owner == 'puppetlabs' }}
51- run : |
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
55-
56- - name : Setup Acceptance Test Matrix
57- id : get-matrix
58- if : ${{ github.repository_owner == 'puppetlabs' }}
59- run : |
60- if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
61- buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2
62- else
63- echo "::set-output name=matrix::{}"
64- fi
65-
66- - name : " Honeycomb: Record Setup Test Matrix time"
67- if : ${{ always() }}
68- run : |
69- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
9+ Spec :
10+ uses : " puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main"
11+ with :
12+ runs_on : " ubuntu-20.04"
13+ secrets : " inherit"
7014
7115 Acceptance :
72- name : " ${{matrix.platforms.label}}, ${{matrix.collection}}"
73- needs :
74- - setup_matrix
75-
76- runs-on : ubuntu-20.04
77- strategy :
78- fail-fast : false
79- matrix : ${{fromJson(needs.setup_matrix.outputs.matrix)}}
80-
81- env :
82- BUILDEVENT_FILE : ' ../buildevents.txt'
83-
84- steps :
85- - run : |
86- echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE
87- echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
88- echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE
89-
90-
91- - name : " Honeycomb: Start recording"
92- uses : puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
93- with :
94- apikey : ${{ env.HONEYCOMB_WRITEKEY }}
95- dataset : ${{ env.HONEYCOMB_DATASET }}
96- job-status : ${{ job.status }}
97- matrix-key : ${{ matrix.platforms.label }}-${{ matrix.collection }}
98-
99- - name : " Honeycomb: start first step"
100- run : |
101- echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
102- echo STEP_START=$(date +%s) >> $GITHUB_ENV
103-
104- - name : Checkout Source
105- uses : actions/checkout@v2
106-
107- - name : Activate Ruby 2.7
108- uses : ruby/setup-ruby@v1
109- with :
110- ruby-version : " 2.7"
111- bundler-cache : true
112-
113- - name : Print bundle environment
114- run : |
115- echo ::group::bundler environment
116- buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
117- echo ::endgroup::
118-
119- - name : " Honeycomb: Record Setup Environment time"
120- if : ${{ always() }}
121- run : |
122- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
123- echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
124- echo STEP_START=$(date +%s) >> $GITHUB_ENV
125-
126- - name : Provision test environment
127- run : |
128- if [[ "${{matrix.platforms.provider}}" == "provision::docker" ]]; then
129- DOCKER_RUN_OPTS="docker_run_opts: {'--volume': '/lib/modules/$(uname -r):/lib/modules/$(uname -r)'}"
130- else
131- DOCKER_RUN_OPTS=''
132- fi
133- buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake "litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }},$DOCKER_RUN_OPTS]"
134- echo ::group::=== REQUEST ===
135- cat request.json || true
136- echo
137- echo ::endgroup::
138- echo ::group::=== INVENTORY ===
139- if [ -f 'spec/fixtures/litmus_inventory.yaml' ];
140- then
141- FILE='spec/fixtures/litmus_inventory.yaml'
142- elif [ -f 'inventory.yaml' ];
143- then
144- FILE='inventory.yaml'
145- fi
146- sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
147- echo ::endgroup::
148-
149- - name : Install agent
150- run : |
151- buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
152-
153- - name : Install module
154- run : |
155- buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
156-
157- - name : " Honeycomb: Record deployment times"
158- if : ${{ always() }}
159- run : |
160- echo ::group::honeycomb step
161- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
162- echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
163- echo STEP_START=$(date +%s) >> $GITHUB_ENV
164- echo ::endgroup::
165-
166- - name : Run acceptance tests
167- run : |
168- buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel'
169-
170- - name : " Honeycomb: Record acceptance testing times"
171- if : ${{ always() }}
172- run : |
173- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
174- echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
175- echo STEP_START=$(date +%s) >> $GITHUB_ENV
176-
177- - name : Remove test environment
178- if : ${{ always() }}
179- continue-on-error : true
180- run : |
181- if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then
182- buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
183- echo ::group::=== REQUEST ===
184- cat request.json || true
185- echo
186- echo ::endgroup::
187- fi
188-
189- - name : " Honeycomb: Record removal times"
190- if : ${{ always() }}
191- run : |
192- buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'
16+ needs : Spec
17+ uses : " puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main"
18+ with :
19+ runs_on : " ubuntu-20.04"
20+ secrets : " inherit"
19321
194- slack-workflow-status :
195- if : always()
196- name : Post Workflow Status To Slack
197- needs :
198- - Acceptance
199- runs-on : ubuntu-20.04
200- steps :
201- - name : Slack Workflow Notification
202- uses : puppetlabs/Gamesight-slack-workflow-status@pdk-templates-v1
203- with :
204- # Required Input
205- repo_token : ${{ secrets.GITHUB_TOKEN }}
206- slack_webhook_url : ${{ secrets.SLACK_WEBHOOK }}
207- # Optional Input
208- channel : ' #team-ia-bots'
209- name : ' GABot'
0 commit comments