@@ -135,94 +135,23 @@ jobs:
135135 if : ${{ steps.vars.outputs.has_creds == 'true' && (!(startsWith(inputs.os, 'amazon') && inputs.version == '2' ))}}
136136 uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
137137 with :
138- name : linux-${{ inputs.version }}-${{ inputs. test-command }} -${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
138+ name : linux-${{ inputs.version }}-test-e2e -${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
139139 path : ${{ github.workspace }}/reports/${{ github.run_id }}-${{ github.run_attempt }}-*.json
140140 - name : Clean up repo AL2
141141 if : ${{ (startsWith(inputs.os, 'amazon') && inputs.version == '2' && always() ) }}
142142 run : |
143143 rm -rf "${GITHUB_WORKSPACE}"
144- upload-linux- e2e-test-report :
144+ upload-e2e-test-reports :
145145 needs : test
146146 if : always()
147- runs-on :
148- [
149- " self-hosted" ,
150- " linux" ,
151- " ${{ inputs.arch }}" ,
152- " ${{ inputs.version }}" ,
153- " ${{ inputs.runner-type }}" ,
154- ]
155- timeout-minutes : 5
156- steps :
157- - name : Set output variables to check AL2
158- id : linux2
159- run : |
160- is_al2=${{ (startsWith(inputs.os, 'amazon') && inputs.version == '2' ) }}
161- echo "is_al2=$is_al2" >> $GITHUB_OUTPUT
162- - name : configure aws credentials
163- uses : aws-actions/configure-aws-credentials@4fc4975a852c8cd99761e2de1f4ba73402e44dd9 # v4.0.3
164- if : |
165- steps.linux2.outputs.is_al2 == 'false'
166- && needs.test.outputs.has_creds == 'true'
167- && github.event_name == 'pull_request'
168- && github.event.action == 'closed'
169- && github.event.pull_request.merged == true
170- with :
171- role-to-assume : ${{ secrets.ROLE }}
172- role-session-name : credhelper-test
173- aws-region : ${{ secrets.REGION }}
174- - name : download artifacts
175- uses : actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.08
176- if : |
177- steps.linux2.outputs.is_al2 == 'false'
178- && needs.test.outputs.has_creds == 'true'
179- && github.event_name == 'pull_request'
180- && github.event.action == 'closed'
181- && github.event.pull_request.merged == true
182- with :
183- name : linux-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
184- path : linux-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
185- - name : Display structure of downloaded files
186- if : |
187- steps.linux2.outputs.is_al2 == 'false'
188- && needs.test.outputs.has_creds == 'true'
189- && github.event_name == 'pull_request'
190- && github.event.action == 'closed'
191- && github.event.pull_request.merged == true
192- run : ls -R linux-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports
193- - name : Check and upload e2e tests reports to s3 bucket
194- if : |
195- steps.linux2.outputs.is_al2 == 'false'
196- && needs.test.outputs.has_creds == 'true'
197- && github.event_name == 'pull_request'
198- && github.event.action == 'closed'
199- && github.event.pull_request.merged == true
200-
201- run : |
202- VM_REPORT="${{ github.workspace }}/linux-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-report.json"
203- CONTAINER_REPORT="${{ github.workspace }}/linux-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-container-report.json"
204- VM_SERIAL_REPORT="${{ github.workspace }}/linux-${{ inputs.version }}-${{ inputs.test-command }}-${{ inputs.arch }}-${{ github.run_id }}-${{ github.run_attempt }}-e2e-reports/${{ github.run_id }}-${{ github.run_attempt }}-e2e-vm-serial-report.json"
205-
206- if [ -f "$VM_REPORT" ]; then
207- echo "VM report file exists. Uploading to S3..."
208- aws s3 cp "$VM_REPORT" "s3://finch-e2e-test-log-reports/linux-${{ inputs.arch }}/${{ needs.test.outputs.vm_report }}"
209- echo "VM report uploaded successfully."
210- else
211- echo "VM report file does not exist. Skipping upload."
212- fi
213-
214- if [ -f "$CONTAINER_REPORT" ]; then
215- echo "Container report file exists. Uploading to S3..."
216- aws s3 cp "$CONTAINER_REPORT" "s3://finch-e2e-test-log-reports/linux-${{ inputs.arch }}/${{ needs.test.outputs.container_report }}"
217- echo "Container report uploaded successfully."
218- else
219- echo "Container report file does not exist. Skipping upload."
220- fi
221-
222- if [ -f "$VM_SERIAL_REPORT" ]; then
223- echo "VM serial report file exists. Uploading to S3..."
224- aws s3 cp "$VM_SERIAL_REPORT" "s3://finch-e2e-test-log-reports/linux-${{ inputs.arch }}/${{ needs.test.outputs.vm_serial_report }}"
225- echo "VM serial report uploaded successfully."
226- else
227- echo "VM serial report file does not exist. Skipping upload."
228- fi
147+ uses : ./.github/workflows/upload-test-report.yaml
148+ secrets : inherit
149+ with :
150+ os : ${{ inputs.os }}
151+ arch : ${{ inputs.arch }}
152+ version : ${{ inputs.version }}
153+ test-command : " test-e2e"
154+ has-creds : ${{ needs.test.outputs.has_creds }}
155+ vm_report : ${{ needs.test.outputs.vm_report }}
156+ container_report : ${{ needs.test.outputs.container_report }}
157+ vm_serial_report : ${{ needs.test.outputs.vm_serial_report }}
0 commit comments