name: Report flaky test description: Finds flaky tests and uploads reports inputs: job-name: description: 'Job name to help identify the job' required: true runs: using: composite steps: - id: flaky-tests name: Find flaky tests if: github.repository == 'keycloak/keycloak' shell: bash # language=bash run: | FLAKES="" SEP="" for dir in $(find -type d -name 'surefire-reports*'); do for i in $(grep -l '> 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<> $GITHUB_OUTPUT echo "job-summary.properties" >> $GITHUB_OUTPUT echo "$FLAKES" >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT fi - uses: actions/upload-artifact@v3 if: ${{ steps.flaky-tests.outputs.flakes }} with: name: flaky-tests-${{ github.job }}-${{ join(matrix.*, '-') }} path: ${{ steps.flaky-tests.outputs.flakes }} if-no-files-found: error