From 7521c88d1e0af51c9adb221b31c4779342a64e9b Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Sat, 2 Nov 2024 22:23:48 +0100 Subject: [PATCH 01/10] Add global Maven settings # Conflicts: # .github/workflows/cibuild.yml --- .github/workflows/cibuild.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index 66162ed6b3a..9e94fa17e5f 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -14,6 +14,12 @@ on: - master - dev-1.x - dev-2.x +env: + # Since version 3.9.0 of Maven it will automatically understand this environment variable. + # However, as of 2024-11 the latest versions of Ubuntu and Debian were on 3.8.8 so it will take some + # time until we can remove the $MAVEN_ARGS below. + MAVEN_ARGS: "--batch-mode --no-transfer-log" + jobs: build-linux: runs-on: ubuntu-latest @@ -61,7 +67,7 @@ jobs: if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev-1.x' || github.ref == 'refs/heads/dev-2.x') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: mvn --batch-mode deploy --settings maven-settings.xml -DskipTests -DGITHUB_REPOSITORY=$GITHUB_REPOSITORY -P prettierSkip -P deployGitHub + run: mvn $MAVEN_ARGS deploy --settings maven-settings.xml -DskipTests -DGITHUB_REPOSITORY=$GITHUB_REPOSITORY -P prettierSkip -P deployGitHub build-windows: timeout-minutes: 20 @@ -79,7 +85,7 @@ jobs: - name: Configure Windows Pagefile uses: al-cheb/configure-pagefile-action@v1.4 - name: Run tests - run: mvn --batch-mode test -P prettierSkip + run: mvn $MAVEN_ARGS test -P prettierSkip docs: if: github.repository_owner == 'opentripplanner' @@ -192,7 +198,7 @@ jobs: distribution: temurin cache: maven - name: Compile Java code - run: mvn --batch-mode compile -DskipTests -P prettierSkip + run: mvn $MAVEN_ARGS compile -DskipTests -P prettierSkip container-image: if: github.repository_owner == 'opentripplanner' && github.event_name == 'push' && (github.ref == 'refs/heads/dev-2.x' || github.ref == 'refs/heads/master') @@ -237,4 +243,4 @@ jobs: MAVEN_SKIP_ARGS="-P prettierSkip -Dmaven.test.skip=true -Dmaven.source.skip=true" - mvn --batch-mode $MAVEN_SKIP_ARGS package com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_version + mvn $MAVEN_ARGS $MAVEN_SKIP_ARGS package com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_version From ff433a3847a014131539ec1f1815df8251afea31 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Sat, 2 Nov 2024 22:54:26 +0100 Subject: [PATCH 02/10] Use MAVEN_ARGS to hide download logs --- .github/workflows/cibuild.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index 9e94fa17e5f..09632ca50be 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -52,8 +52,8 @@ jobs: # https://github.com/actions/runner-images/issues/1499 # we set nodePath and npmPath to skip downloading the node binary, which frequently times out run: | - mvn --batch-mode jacoco:prepare-agent test jacoco:report -P prettierCheck -Dprettier.nodePath=node -Dprettier.npmPath=npm - mvn --batch-mode package -Dmaven.test.skip -P prettierSkip + mvn $MAVEN_ARGS jacoco:prepare-agent test jacoco:report -P prettierCheck -Dprettier.nodePath=node -Dprettier.npmPath=npm + mvn $MAVEN_ARGS package -Dmaven.test.skip -P prettierSkip - name: Send coverage data to codecov.io if: github.repository_owner == 'opentripplanner' From 34c7863634d0da7e53d302de99bc4822a4d803e0 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Sat, 2 Nov 2024 22:59:11 +0100 Subject: [PATCH 03/10] Add Unicode theme --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 284153b6486..e043093c928 100644 --- a/pom.xml +++ b/pom.xml @@ -236,6 +236,7 @@ true true false + UNICODE From 2b45e355d0c8ea702d648988f281fb1af4bedde2 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 4 Nov 2024 08:32:05 +0100 Subject: [PATCH 04/10] Use correct command --- .github/workflows/cibuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index 09632ca50be..e2796d28df5 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -18,7 +18,7 @@ env: # Since version 3.9.0 of Maven it will automatically understand this environment variable. # However, as of 2024-11 the latest versions of Ubuntu and Debian were on 3.8.8 so it will take some # time until we can remove the $MAVEN_ARGS below. - MAVEN_ARGS: "--batch-mode --no-transfer-log" + MAVEN_ARGS: "--batch-mode --no-transfer-progress" jobs: build-linux: From fae5108217f5790114df11f5ed29e1d8b102d5a1 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 4 Nov 2024 08:35:06 +0100 Subject: [PATCH 05/10] Enable colour --- .github/workflows/cibuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index e2796d28df5..1be659deaa6 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -18,7 +18,7 @@ env: # Since version 3.9.0 of Maven it will automatically understand this environment variable. # However, as of 2024-11 the latest versions of Ubuntu and Debian were on 3.8.8 so it will take some # time until we can remove the $MAVEN_ARGS below. - MAVEN_ARGS: "--batch-mode --no-transfer-progress" + MAVEN_ARGS: "--no-transfer-progress -Dstyle.color=always" jobs: build-linux: From 9c1d4329fef5b3a7e52667a70af4bfb58dab6dae Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 4 Nov 2024 08:36:53 +0100 Subject: [PATCH 06/10] Use jacoco:report-aggregate --- .github/workflows/cibuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index 1be659deaa6..90bd2731604 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -52,7 +52,7 @@ jobs: # https://github.com/actions/runner-images/issues/1499 # we set nodePath and npmPath to skip downloading the node binary, which frequently times out run: | - mvn $MAVEN_ARGS jacoco:prepare-agent test jacoco:report -P prettierCheck -Dprettier.nodePath=node -Dprettier.npmPath=npm + mvn $MAVEN_ARGS jacoco:prepare-agent test jacoco:report-aggregate -P prettierCheck -Dprettier.nodePath=node -Dprettier.npmPath=npm mvn $MAVEN_ARGS package -Dmaven.test.skip -P prettierSkip - name: Send coverage data to codecov.io From 325cb1246faa6cc02b2a48be684e249c33db4d8b Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 4 Nov 2024 08:58:17 +0100 Subject: [PATCH 07/10] Update path for aggregated jacoco results --- .github/workflows/cibuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index 90bd2731604..2331179b832 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -59,7 +59,7 @@ jobs: if: github.repository_owner == 'opentripplanner' uses: codecov/codecov-action@v4 with: - files: target/site/jacoco/jacoco.xml + files: target/site/jacoco-aggregate/jacoco.xml token: ${{ secrets.CODECOV_TOKEN }} verbose: true From 56514dc604e2b42f86b2263b9197cd8fdfb9c9e5 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 4 Nov 2024 10:12:00 +0100 Subject: [PATCH 08/10] Remove hardcoded path --- .github/workflows/cibuild.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index 2331179b832..a44257b7bf3 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -52,14 +52,13 @@ jobs: # https://github.com/actions/runner-images/issues/1499 # we set nodePath and npmPath to skip downloading the node binary, which frequently times out run: | - mvn $MAVEN_ARGS jacoco:prepare-agent test jacoco:report-aggregate -P prettierCheck -Dprettier.nodePath=node -Dprettier.npmPath=npm + mvn $MAVEN_ARGS jacoco:prepare-agent test jacoco:report -P prettierCheck -Dprettier.nodePath=node -Dprettier.npmPath=npm mvn $MAVEN_ARGS package -Dmaven.test.skip -P prettierSkip - name: Send coverage data to codecov.io if: github.repository_owner == 'opentripplanner' uses: codecov/codecov-action@v4 with: - files: target/site/jacoco-aggregate/jacoco.xml token: ${{ secrets.CODECOV_TOKEN }} verbose: true From 28fbcf1f63909f4a9c0950757bae94a52c46b8cb Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 4 Nov 2024 14:12:51 +0100 Subject: [PATCH 09/10] Add test result uploads --- .github/workflows/cibuild.yml | 7 +++++++ pom.xml | 2 -- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index a44257b7bf3..84bdf2e84f0 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -62,6 +62,13 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} verbose: true + - name: Upload test results to Codecov + # always upload test results, even when failed + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + - name: Deploy to Github Package Registry if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev-1.x' || github.ref == 'refs/heads/dev-2.x') env: diff --git a/pom.xml b/pom.xml index e043093c928..03b94662123 100644 --- a/pom.xml +++ b/pom.xml @@ -221,8 +221,6 @@ --add-opens java.base/sun.invoke.util=ALL-UNNAMED --add-opens java.xml/org.xml.sax.helpers=ALL-UNNAMED - - true plain true From 9063f9337a3635045dcf6aebe5eb0878a4175bf5 Mon Sep 17 00:00:00 2001 From: Leonard Ehrenfried Date: Mon, 4 Nov 2024 21:30:11 +0100 Subject: [PATCH 10/10] Add file pattern for all tests --- .github/workflows/cibuild.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cibuild.yml b/.github/workflows/cibuild.yml index 84bdf2e84f0..212c3934dc2 100644 --- a/.github/workflows/cibuild.yml +++ b/.github/workflows/cibuild.yml @@ -68,6 +68,7 @@ jobs: uses: codecov/test-results-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} + files: "*TEST-*.xml" - name: Deploy to Github Package Registry if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev-1.x' || github.ref == 'refs/heads/dev-2.x')