8 HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
9 HONEYCOMB_DATASET: litmus tests
13 name: "Setup Test Matrix"
16 matrix: ${{ steps.get-matrix.outputs.matrix }}
19 - name: "Honeycomb: Start recording"
20 uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
22 apikey: ${{ env.HONEYCOMB_WRITEKEY }}
23 dataset: ${{ env.HONEYCOMB_DATASET }}
24 job-status: ${{ job.status }}
26 - name: "Honeycomb: Start first step"
28 echo STEP_ID=setup-environment >> $GITHUB_ENV
29 echo STEP_START=$(date +%s) >> $GITHUB_ENV
31 - name: Checkout Source
32 uses: actions/checkout@v2
33 if: ${{ github.repository_owner == 'puppetlabs' }}
35 - name: Activate Ruby 2.7
36 uses: ruby/setup-ruby@v1
37 if: ${{ github.repository_owner == 'puppetlabs' }}
42 - name: Print bundle environment
43 if: ${{ github.repository_owner == 'puppetlabs' }}
45 echo ::group::bundler environment
46 buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
49 - name: "Honeycomb: Record Setup Environment time"
50 if: ${{ github.repository_owner == 'puppetlabs' }}
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
56 - name: Setup Acceptance Test Matrix
58 if: ${{ github.repository_owner == 'puppetlabs' }}
60 if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
61 buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2
63 echo "::set-output name=matrix::{}"
66 - name: "Honeycomb: Record Setup Test Matrix time"
69 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
72 name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
79 matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
82 BUILDEVENT_FILE: '../buildevents.txt'
86 echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE
87 echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
88 echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE
91 - name: "Honeycomb: Start recording"
92 uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
94 apikey: ${{ env.HONEYCOMB_WRITEKEY }}
95 dataset: ${{ env.HONEYCOMB_DATASET }}
96 job-status: ${{ job.status }}
97 matrix-key: ${{ matrix.platforms.label }}-${{ matrix.collection }}
99 - name: "Honeycomb: start first step"
101 echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
102 echo STEP_START=$(date +%s) >> $GITHUB_ENV
104 - name: Checkout Source
105 uses: actions/checkout@v2
107 - name: Activate Ruby 2.7
108 uses: ruby/setup-ruby@v1
113 - name: Print bundle environment
115 echo ::group::bundler environment
116 buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
119 - name: "Honeycomb: Record Setup Environment time"
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
126 - name: Provision test environment
128 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]'
129 echo ::group::=== REQUEST ===
130 cat request.json || true
133 echo ::group::=== INVENTORY ===
134 sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true
137 - name: Install agent
139 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
141 - name: Install module
143 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
145 - name: "Honeycomb: Record deployment times"
148 echo ::group::honeycomb step
149 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
150 echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
151 echo STEP_START=$(date +%s) >> $GITHUB_ENV
154 - name: Run acceptance tests
156 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel'
158 - name: "Honeycomb: Record acceptance testing times"
161 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
162 echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
163 echo STEP_START=$(date +%s) >> $GITHUB_ENV
165 - name: Remove test environment
167 continue-on-error: true
169 if [ -f inventory.yaml ]; then
170 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
171 echo ::group::=== REQUEST ===
172 cat request.json || true
177 - name: "Honeycomb: Record removal times"
180 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'
182 slack-workflow-status:
184 name: Post Workflow Status To Slack
187 runs-on: ubuntu-20.04
189 - name: Slack Workflow Notification
190 uses: puppetlabs/Gamesight-slack-workflow-status@pdk-templates-v1
193 repo_token: ${{ secrets.GITHUB_TOKEN }}
194 slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }}
196 channel: '#team-ia-bots'