8 HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
9 HONEYCOMB_DATASET: litmus tests
13 name: "Setup Test Matrix"
16 matrix: ${{ steps.get-matrix.outputs.matrix }}
20 - name: "Honeycomb: Start recording"
21 uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
23 apikey: ${{ env.HONEYCOMB_WRITEKEY }}
24 dataset: ${{ env.HONEYCOMB_DATASET }}
25 job-status: ${{ job.status }}
27 - name: "Honeycomb: Start first step"
29 echo STEP_ID=setup-environment >> $GITHUB_ENV
30 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
55 - name: Run validation steps
57 bundle exec rake validate
58 if: ${{ github.repository_owner == 'puppetlabs' }}
60 - name: Setup Acceptance Test Matrix
63 if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then
64 buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2
66 echo "::set-output name=matrix::{}"
69 - name: "Honeycomb: Record Setup Test Matrix time"
72 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix'
74 name: "${{matrix.platforms.label}}, ${{matrix.collection}}"
77 if: ${{ needs.setup_matrix.outputs.matrix != '{}' }}
82 matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}}
85 BUILDEVENT_FILE: '../buildevents.txt'
89 echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE
90 echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE
91 echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE
93 - name: "Honeycomb: Start recording"
94 uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
96 apikey: ${{ env.HONEYCOMB_WRITEKEY }}
97 dataset: ${{ env.HONEYCOMB_DATASET }}
98 job-status: ${{ job.status }}
99 matrix-key: ${{ matrix.platforms.label }}-${{ matrix.collection }}
101 - name: "Honeycomb: start first step"
103 echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV
104 echo STEP_START=$(date +%s) >> $GITHUB_ENV
105 - name: Checkout Source
106 uses: actions/checkout@v2
108 - name: Activate Ruby 2.7
109 uses: ruby/setup-ruby@v1
114 - name: Print bundle environment
116 echo ::group::bundler environment
117 buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env
120 - name: "Honeycomb: Record Setup Environment time"
123 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment'
124 echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV
125 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 if [ -f 'spec/fixtures/litmus_inventory.yaml' ];
136 FILE='spec/fixtures/litmus_inventory.yaml'
137 elif [ -f 'inventory.yaml' ];
139 FILE='inventory.yaml'
141 sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true
144 - name: Install agent
146 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]'
148 - name: Install module
150 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module'
152 - name: "Honeycomb: Record deployment times"
155 echo ::group::honeycomb step
156 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system'
157 echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV
158 echo STEP_START=$(date +%s) >> $GITHUB_ENV
160 - name: Run acceptance tests
162 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel'
164 - name: "Honeycomb: Record acceptance testing times"
167 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests'
168 echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV
169 echo STEP_START=$(date +%s) >> $GITHUB_ENV
170 - name: Remove test environment
172 continue-on-error: true
174 if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then
175 buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down'
176 echo ::group::=== REQUEST ===
177 cat request.json || true
182 - name: "Honeycomb: Record removal times"
185 buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment'