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: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2
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=0 >> $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: actions/setup-ruby@v1
37 if: ${{ github.repository_owner == 'puppetlabs' }}
42 uses: actions/cache@v2
43 if: ${{ github.repository_owner == 'puppetlabs' }}
46 key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
48 ${{ runner.os }}-${{ github.event_name }}-
52 if: ${{ github.repository_owner == 'puppetlabs' }}
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
60 - name: Setup Acceptance Test Matrix
62 if: ${{ github.repository_owner == 'puppetlabs' }}
64 if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
65 buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata
67 echo "::set-output name=matrix::{}"
70 - name: "Honeycomb: Record setup time"
73 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
82 matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
85 BUILDEVENT_FILE: '../buildevents.txt'
89 echo 'platform=${{ matrix.platform }}' >> $BUILDEVENT_FILE
90 echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
92 - name: "Honeycomb: Start recording"
93 uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2
95 apikey: ${{ env.HONEYCOMB_WRITEKEY }}
96 dataset: ${{ env.HONEYCOMB_DATASET }}
97 job-status: ${{ job.status }}
98 matrix-key: ${{ matrix.platform }}-${{ matrix.collection }}
100 - name: "Honeycomb: start first step"
102 echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
103 echo STEP_START=$(date +%s) >> $GITHUB_ENV
105 - name: Checkout Source
106 uses: actions/checkout@v2
108 - name: Activate Ruby 2.7
109 uses: actions/setup-ruby@v1
114 uses: actions/cache@v2
117 key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }}
119 ${{ runner.os }}-${{ github.event_name }}-
122 - name: "Honeycomb: Record cache setup time"
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
129 - name: Bundler Setup
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
136 echo ::group::bundler environment
137 buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
140 - name: "Honeycomb: Record Bundler Setup time"
143 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup'
144 echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
145 echo STEP_START=$(date +%s) >> $GITHUB_ENV
147 - name: Provision test environment
149 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platform }}' -- bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]'
150 echo ::group::=== REQUEST ===
151 cat request.json || true
154 echo ::group::=== INVENTORY ===
155 sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true
158 - name: Install agent
160 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
162 - name: Install module
164 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
166 - name: "Honeycomb: Record deployment times"
169 echo ::group::honeycomb step
170 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
171 echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
172 echo STEP_START=$(date +%s) >> $GITHUB_ENV
175 - name: Run acceptance tests
177 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel'
179 - name: "Honeycomb: Record acceptance testing times"
182 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
183 echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV
184 echo STEP_START=$(date +%s) >> $GITHUB_ENV
186 - name: Remove test environment
189 if [ -f inventory.yaml ]; then
190 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
191 echo ::group::=== REQUEST ===
192 cat request.json || true
197 - name: "Honeycomb: Record removal times"
200 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'
202 slack-workflow-status:
204 name: Post Workflow Status To Slack
207 runs-on: ubuntu-20.04
209 - name: Slack Workflow Notification
210 uses: Gamesight/slack-workflow-status@88ee95b73b4669825883ddf22747966204663e58 # pin@master
213 repo_token: ${{ secrets.GITHUB_TOKEN }}
214 slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }}
216 channel: '#team-ia-bots'