From ac2cba4e9a48f63b4ef72c5b673e76257e8dd0e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Vav=C5=99=C3=ADk?= Date: Wed, 25 Sep 2024 21:33:38 +0200 Subject: [PATCH] Improve GH PR comments for flaky tests --- .github/workflows/add-flaky-test-label.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/add-flaky-test-label.yml b/.github/workflows/add-flaky-test-label.yml index e0e6b68ee..9ef50f848 100644 --- a/.github/workflows/add-flaky-test-label.yml +++ b/.github/workflows/add-flaky-test-label.yml @@ -19,6 +19,13 @@ jobs: - name: 'Get PR number' if: ${{ hashFiles('**/jobs-with-flaky-tests') != '' }} run: gh run download $WORKFLOW_ID -n pr-number || true + - name: 'Download Flaky Run Reports' + if: ${{ hashFiles('**/pr-number') != '' }} + run: | + gh run download $WORKFLOW_ID -n flaky-run-report-linux-jvm-released || true + gh run download $WORKFLOW_ID -n flaky-run-report-linux-jvm-latest || true + gh run download $WORKFLOW_ID -n flaky-run-report-linux-native-released || true + gh run download $WORKFLOW_ID -n flaky-run-report-windows-jvm-latest || true - name: 'Add "triage/flaky-test" label' if: ${{ hashFiles('**/pr-number') != '' }} run: | @@ -26,4 +33,6 @@ jobs: - name: 'Comment on PR about flaky tests' if: ${{ hashFiles('**/pr-number') != '' }} run: | - gh pr comment "$(cat pr-number)" --body "Following jobs contain at least one flaky test: $(cat jobs-with-flaky-tests)" + curl -Ls https://sh.jbang.dev | bash -s - app setup + ~/.jbang/bin/jbang trust add https://raw.githubusercontent.com/quarkus-qe/flaky-run-reporter/main/jbang-scripts/ + gh pr comment "$(cat pr-number)" --body "$(~/.jbang/bin/jbang https://raw.githubusercontent.com/quarkus-qe/flaky-run-reporter/main/jbang-scripts/GitHubPrCommentator.java overview-file=jobs-with-flaky-tests flaky-reports-file-prefix=flaky-run-report)"