From a95cdc49161b2f06407ebeb763240234fed5910f Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 8 Nov 2023 11:00:45 +0100 Subject: [PATCH 1/9] Testing GH workflow --- .github/workflows/pr.yml | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 000000000..14170d8b7 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,42 @@ +name: 'Build Pull Request' +run-name: Build for PR ${{ github.event.pull_request.number }} + +on: + pull_request: + types: + - synchronize + - opened + - ready_for_review + - reopened + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + include: + - java: [8, 11, 17] + gradle: 7.4 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1000 + fetch-tags: true + + - name: Setup JDK ${{ matrix.java }} + uses: actions/setup-java@v2 + with: + java-version: ${{ matrix.java }} + distribution: 'microsoft' + + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + with: + gradle-version: ${{ matrix.gradle }} + + - name: Build + run: gradle -x test build + + - name: Test + run: gradle test From 3fa9ddb3eee07dbabd19d1b67af6c14def36bb80 Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 8 Nov 2023 11:04:08 +0100 Subject: [PATCH 2/9] Testing GH workflow --- .github/workflows/pr.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 14170d8b7..cd9b55aad 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,7 +15,11 @@ jobs: strategy: matrix: include: - - java: [8, 11, 17] + - java: 8 + gradle: 7.4 + - java: 11 + gradle: 7.4 + - java: 17 gradle: 7.4 steps: - name: Checkout repository From d2bf5f3183b9151e7f2d4413624e519e5475eaf2 Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 8 Nov 2023 11:08:06 +0100 Subject: [PATCH 3/9] No JDK 8 from MS --- .github/workflows/pr.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index cd9b55aad..02e9dee86 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -15,8 +15,6 @@ jobs: strategy: matrix: include: - - java: 8 - gradle: 7.4 - java: 11 gradle: 7.4 - java: 17 From 1e311e8024bf8402482e494de63c916e962c6539 Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 8 Nov 2023 11:09:10 +0100 Subject: [PATCH 4/9] Better displayed name. --- .github/workflows/pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 02e9dee86..551d57bd0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,8 +11,10 @@ on: jobs: build: + name: Build (Java ${{ matrix.java }}, Gradle ${{ matrix.gradle }}) runs-on: ubuntu-latest strategy: + fail-fast: false matrix: include: - java: 11 From 903302033e6142eee6345b2767c934da169aec2c Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 8 Nov 2023 11:16:08 +0100 Subject: [PATCH 5/9] Adapted to how the TC build actually runs today --- .github/workflows/pr.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 551d57bd0..3cfea9766 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,16 +11,8 @@ on: jobs: build: - name: Build (Java ${{ matrix.java }}, Gradle ${{ matrix.gradle }}) + name: Build runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - include: - - java: 11 - gradle: 7.4 - - java: 17 - gradle: 7.4 steps: - name: Checkout repository uses: actions/checkout@v4 @@ -28,19 +20,17 @@ jobs: fetch-depth: 1000 fetch-tags: true - - name: Setup JDK ${{ matrix.java }} + - name: Setup JDK uses: actions/setup-java@v2 with: - java-version: ${{ matrix.java }} + java-version: '17' distribution: 'microsoft' - name: Setup Gradle uses: gradle/gradle-build-action@v2 - with: - gradle-version: ${{ matrix.gradle }} - name: Build - run: gradle -x test build + run: ./gradlew --info -s -x test build - name: Test - run: gradle test + run: ./gradlew --info -s test From 7d785f9ccb43529f9ca37599a0c34298530a148a Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 8 Nov 2023 12:15:12 +0100 Subject: [PATCH 6/9] check vs. test --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 3cfea9766..2669c40ef 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -30,7 +30,7 @@ jobs: uses: gradle/gradle-build-action@v2 - name: Build - run: ./gradlew --info -s -x test build + run: ./gradlew --info -s -x check build - name: Test - run: ./gradlew --info -s test + run: ./gradlew --info -s check From 38c4408aa610d424a3b6f6b246af6839d9e5f9ef Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 8 Nov 2023 13:13:59 +0100 Subject: [PATCH 7/9] Try setting up test reporting... --- .github/workflows/pr.yml | 11 +++++++++-- .github/workflows/test-report.yml | 20 ++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/test-report.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 2669c40ef..540e1fffc 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -11,7 +11,7 @@ on: jobs: build: - name: Build + name: Build and Test runs-on: ubuntu-latest steps: - name: Checkout repository @@ -21,7 +21,7 @@ jobs: fetch-tags: true - name: Setup JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: '17' distribution: 'microsoft' @@ -34,3 +34,10 @@ jobs: - name: Test run: ./gradlew --info -s check + + # Always upload test results + - uses: actions/upload-artifact@v3 + if: success() || failure() + with: + name: test-results + path: "**/TEST-*.xml" diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml new file mode 100644 index 000000000..8804adedb --- /dev/null +++ b/.github/workflows/test-report.yml @@ -0,0 +1,20 @@ +name: 'Test Report' +on: + workflow_run: + workflows: ['pr'] + types: + - completed +permissions: + contents: read + actions: read + checks: write +jobs: + report: + runs-on: ubuntu-latest + steps: + - uses: dorny/test-reporter@v1 + with: + artifact: test-results + name: Tests + path: '**/*.xml' + reporter: java-junit From b53e46b06b3b8de0d6254890662c229ded8cf5e2 Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 8 Nov 2023 16:39:54 +0100 Subject: [PATCH 8/9] Merge test results prior to upload. --- .github/workflows/pr.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 540e1fffc..0896f29c7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -36,8 +36,12 @@ jobs: run: ./gradlew --info -s check # Always upload test results + - name: Merge Test Reports + if: success() || failure() + run: npx junit-report-merger junit.xml "**/TEST-*.xml" + - uses: actions/upload-artifact@v3 if: success() || failure() with: name: test-results - path: "**/TEST-*.xml" + path: junit.xml From 7520a521009e21f52e40ec14af0627eb4dcbf312 Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Wed, 8 Nov 2023 16:44:06 +0100 Subject: [PATCH 9/9] Merge test results prior to upload. --- .github/workflows/test-report.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-report.yml b/.github/workflows/test-report.yml index 8804adedb..4bb1f87cd 100644 --- a/.github/workflows/test-report.yml +++ b/.github/workflows/test-report.yml @@ -1,7 +1,7 @@ name: 'Test Report' on: workflow_run: - workflows: ['pr'] + workflows: ['Build Pull Request'] types: - completed permissions: @@ -18,3 +18,7 @@ jobs: name: Tests path: '**/*.xml' reporter: java-junit + # This should not affect the result of the check created + # for the origin PR. This just affects this post-processing job itself. + fail-on-error: false + fail-on-empty: false \ No newline at end of file