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@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@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 # The provision service hands out machines as soon as they're provisioned.
159 # The GCP VMs might still take a while to spool up and configure themselves fully.
160 # This retry loop spins until all agents have been installed successfully.
161 - name: Install agent
162 uses: nick-invision/retry@v1
166 retry_wait_seconds: 60
167 command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
169 # The agent installer on windows does not finish in time for this to work. To
170 # work around this for now, retry after a minute if installing the module failed.
171 - name: Install module
172 uses: nick-invision/retry@v1
176 retry_wait_seconds: 60
177 command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
179 - name: "Honeycomb: Record deployment times"
182 echo ::group::honeycomb step
183 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
184 echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
185 echo STEP_START=$(date +%s) >> $GITHUB_ENV
188 - name: Run acceptance tests
190 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel'
192 - name: "Honeycomb: Record acceptance testing times"
195 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
196 echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV
197 echo STEP_START=$(date +%s) >> $GITHUB_ENV
199 - name: Remove test environment
202 if [ -f inventory.yaml ]; then
203 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
204 echo ::group::=== REQUEST ===
205 cat request.json || true
210 - name: "Honeycomb: Record removal times"
213 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'
215 slack-workflow-status:
217 name: Post Workflow Status To Slack
220 runs-on: ubuntu-20.04
222 - name: Slack Workflow Notification
223 uses: Gamesight/slack-workflow-status@master
226 repo_token: ${{ secrets.GITHUB_TOKEN }}
227 slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }}
229 channel: '#team-ia-bots'