-
Notifications
You must be signed in to change notification settings - Fork 35
44 lines (44 loc) · 2.01 KB
/
add-flaky-test-label.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Add 'triage/flaky-test' label and inform if PR CI run contained flaky tests
on:
workflow_run:
workflows: ["Pull Request CI"]
types:
- completed
jobs:
handle-flaky-tests-in-pr-ci:
runs-on: ubuntu-latest
permissions:
pull-requests: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
WORKFLOW_ID: ${{ github.event.workflow_run.id }}
steps:
- name: 'Download "jobs-with-flaky-tests" artifact'
run: gh run download $WORKFLOW_ID -n jobs-with-flaky-tests || true
- 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-latest || true
gh run download $WORKFLOW_ID -n flaky-run-report-linux-native-latest || 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: |
gh pr edit "$(cat pr-number)" --add-label 'triage/flaky-test'
- name: Install JDK 21 for JBang
uses: actions/setup-java@v4
if: ${{ hashFiles('**/pr-number') != '' }}
with:
distribution: 'temurin'
java-version: 21
check-latest: true
- name: 'Comment on PR about flaky tests'
if: ${{ hashFiles('**/pr-number') != '' }}
run: |
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)"