Add job summary to flaky tests artifact (#16215)

This commit is contained in:
Stian Thorgersen 2023-01-02 14:02:20 +01:00 committed by GitHub
parent ce6b737e33
commit d81c4d7c0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 2 deletions

View file

@ -1,5 +1,9 @@
name: Report flaky test name: Report flaky test
description: Finds flaky tests and uploads reports description: Finds flaky tests and uploads reports
inputs:
job-name:
description: 'Job name to help identify the job'
required: true
runs: runs:
using: composite using: composite
@ -20,7 +24,25 @@ runs:
done done
if [ "$FLAKES" != "" ]; then if [ "$FLAKES" != "" ]; then
PR="${{ github.event.number }}"
JOB_NAME="${{ inputs.job-name }}"
MATRIX="${{ join(matrix.*, ' - ') }}"
if [ "$MATRIX" != "" ]; then
JOB_NAME="$JOB_NAME ($MATRIX)"
fi
JOB_URL=$(gh api repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs --jq ".jobs | map(select(.name == \"$JOB_NAME\")) | .[].html_url")
echo "job_name=$JOB_NAME" >> job-summary.properties
echo "job_url=$JOB_URL" >> job-summary.properties
if [ "$PR" != "" ]; then
echo "pr=$PR" >> job-summary.properties
echo "pr_url=https://github.com/${{ github.repository }}/pull/$PR" >> job-summary.properties
fi
echo "flakes<<EOF" >> $GITHUB_OUTPUT echo "flakes<<EOF" >> $GITHUB_OUTPUT
echo "job-summary.properties" >> $GITHUB_OUTPUT
echo "$FLAKES" >> $GITHUB_OUTPUT echo "$FLAKES" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT
fi fi
@ -28,6 +50,6 @@ runs:
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
if: ${{ steps.flaky-tests.outputs.flakes }} if: ${{ steps.flaky-tests.outputs.flakes }}
with: with:
name: flaky-tests-${{ github.job }} name: flaky-tests-${{ github.job }}-${{ join(matrix.*, '-') }}
path: ${{ steps.flaky-tests.outputs.flakes }} path: ${{ steps.flaky-tests.outputs.flakes }}
if-no-files-found: error if-no-files-found: error

View file

@ -106,6 +106,10 @@ jobs:
- uses: ./.github/actions/upload-flaky-tests - uses: ./.github/actions/upload-flaky-tests
name: Upload flaky tests name: Upload flaky tests
env:
GH_TOKEN: ${{ github.token }}
with:
job-name: Base IT
quarkus-integration-tests: quarkus-integration-tests:
name: Quarkus IT name: Quarkus IT