From bf51bd0db8484788bbeae81e8824a038435d08cf Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Sun, 9 Apr 2023 21:59:21 +0100 Subject: [PATCH 1/7] [refactor] There is only one JDK version in use in CI See https://github.com/eXist-db/exist/pull/4852#discussion_r1160607355 --- .github/workflows/ci-test.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 33f603fd7f6..0816ef00502 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -42,26 +42,25 @@ jobs: cache: 'maven' - run: mvn -V -B -q -T 2C install javadoc:javadoc -DskipTests -D'dependency-check.skip' -D'license.skip' --projects '!exist-distribution,!exist-installer' --also-make test: - name: (JDK ${{ matrix.jdk }} / ${{ matrix.os }}) Test + name: ${{ matrix.os }} Test strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macOS-latest] - jdk: [ '17' ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - name: Set up JDK ${{ matrix.jdk }} + - name: Set up JDK uses: actions/setup-java@v3 with: distribution: temurin - java-version: ${{ matrix.jdk }} + java-version: ${{ env.DEV_JDK }} cache: 'maven' - name: Maven Test timeout-minutes: 60 run: mvn -V -B verify -D'dependency-check.skip' -D'license.skip' - name: Maven Code Coverage - if: ${{ github.ref == 'refs/heads/develop' && matrix.jdk == env.DEV_JDK && matrix.os == 'ubuntu-latest' }} + if: ${{ github.ref == 'refs/heads/develop' && matrix.os == 'ubuntu-latest' }} env: CI_NAME: github BRANCH_NAME_OR_REF: ${{ github.head_ref || github.ref }} @@ -73,7 +72,7 @@ jobs: if: always() uses: actions/upload-artifact@v3 with: - name: ${{ runner.os }}-jdk${{ matrix.jdk }}-build-logs + name: ${{ runner.os }}-build-logs retention-days: 5 path: | **/*.jfr From e0630c4f919686f40532f0752000091bafd15859 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Sun, 9 Apr 2023 22:04:35 +0100 Subject: [PATCH 2/7] [bugfix] Reinstate full stack-traces in CI See https://github.com/eXist-db/exist/pull/4852#discussion_r1160607848 --- .github/workflows/ci-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 0816ef00502..1423499e123 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -58,7 +58,7 @@ jobs: cache: 'maven' - name: Maven Test timeout-minutes: 60 - run: mvn -V -B verify -D'dependency-check.skip' -D'license.skip' + run: mvn -V -B verify -DtrimStackTrace=false -D'dependency-check.skip' -D'license.skip' - name: Maven Code Coverage if: ${{ github.ref == 'refs/heads/develop' && matrix.os == 'ubuntu-latest' }} env: From 889fdebaa6675d5bc25e5cafb8963f63688e6eb3 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Sun, 9 Apr 2023 23:03:24 +0100 Subject: [PATCH 3/7] [optimise] Down over-contend on threads in CI jobs, just use 1x Core Count --- .github/workflows/ci-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 1423499e123..3e2c3b68ca6 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -40,7 +40,7 @@ jobs: distribution: temurin java-version: ${{ env.DEV_JDK }} cache: 'maven' - - run: mvn -V -B -q -T 2C install javadoc:javadoc -DskipTests -D'dependency-check.skip' -D'license.skip' --projects '!exist-distribution,!exist-installer' --also-make + - run: mvn -V -B -q -T 1C install javadoc:javadoc -DskipTests -D'dependency-check.skip' -D'license.skip' --projects '!exist-distribution,!exist-installer' --also-make test: name: ${{ matrix.os }} Test strategy: From e6eecceebcdc1f5c8b1652f04c311093e5d8a20c Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Sun, 9 Apr 2023 23:06:23 +0100 Subject: [PATCH 4/7] [optimise] Compilation of modules can be performed in parallel in CI --- .github/workflows/ci-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 3e2c3b68ca6..4d4b6ab832d 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -56,6 +56,9 @@ jobs: distribution: temurin java-version: ${{ env.DEV_JDK }} cache: 'maven' + - name: Maven Build + timeout-minutes: 10 + run: mvn -V -B -T 1C compile test-compile -DtrimStackTrace=false -D'dependency-check.skip' -D'license.skip' - name: Maven Test timeout-minutes: 60 run: mvn -V -B verify -DtrimStackTrace=false -D'dependency-check.skip' -D'license.skip' From 35a9de95e1dfe2c057aff3448a30aa5dde5e838b Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Sun, 9 Apr 2023 23:14:24 +0100 Subject: [PATCH 5/7] [optimise] Remove duplication of Maven phases between Test and Javadoc CI jobs See https://github.com/eXist-db/exist/pull/4852\#discussion_r116060715 --- .github/workflows/ci-test.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 4d4b6ab832d..dd2c5d56333 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -30,17 +30,6 @@ jobs: cache: 'maven' - run: mvn -V -B dependency-check:check timeout-minutes: 60 - documentation: - name: Javadoc - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: temurin - java-version: ${{ env.DEV_JDK }} - cache: 'maven' - - run: mvn -V -B -q -T 1C install javadoc:javadoc -DskipTests -D'dependency-check.skip' -D'license.skip' --projects '!exist-distribution,!exist-installer' --also-make test: name: ${{ matrix.os }} Test strategy: @@ -62,6 +51,9 @@ jobs: - name: Maven Test timeout-minutes: 60 run: mvn -V -B verify -DtrimStackTrace=false -D'dependency-check.skip' -D'license.skip' + - name: Javadoc (Linux only) + if: ${{ matrix.os == 'ubuntu-latest' }} + run: mvn -V -B -q -T 1C install javadoc:javadoc -DskipTests -D'dependency-check.skip' -D'license.skip' --projects '!exist-distribution,!exist-installer' --also-make - name: Maven Code Coverage if: ${{ github.ref == 'refs/heads/develop' && matrix.os == 'ubuntu-latest' }} env: From add32aa33a1fdefedee08363e3c1004e31b118d9 Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Sun, 9 Apr 2023 23:15:14 +0100 Subject: [PATCH 6/7] [doc] Improve CI job step title --- .github/workflows/ci-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index dd2c5d56333..f4bc7b12b14 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -54,7 +54,7 @@ jobs: - name: Javadoc (Linux only) if: ${{ matrix.os == 'ubuntu-latest' }} run: mvn -V -B -q -T 1C install javadoc:javadoc -DskipTests -D'dependency-check.skip' -D'license.skip' --projects '!exist-distribution,!exist-installer' --also-make - - name: Maven Code Coverage + - name: Maven Code Coverage (Develop branch on Linux only) if: ${{ github.ref == 'refs/heads/develop' && matrix.os == 'ubuntu-latest' }} env: CI_NAME: github From 7c24e8df410e18fd66912b63bbcca2ec5183f54f Mon Sep 17 00:00:00 2001 From: Adam Retter Date: Mon, 10 Apr 2023 03:24:33 +0100 Subject: [PATCH 7/7] [refactor] Separate the Caches used by different CI workflows --- .github/workflows/ci-deploy.yml | 4 ++-- .github/workflows/ci-xqts.yml | 7 ++++++- .github/workflows/sonarcloud.yml | 8 ++++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-deploy.yml b/.github/workflows/ci-deploy.yml index 6aa1218fa81..2dd87883acb 100644 --- a/.github/workflows/ci-deploy.yml +++ b/.github/workflows/ci-deploy.yml @@ -24,8 +24,8 @@ jobs: uses: actions/cache@v3 with: path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 + key: deploy-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: deploy-${{ runner.os }}-maven - name: Install bats run: sudo apt-get install bats - name: Build images diff --git a/.github/workflows/ci-xqts.yml b/.github/workflows/ci-xqts.yml index 3593ee0897d..02a83032e01 100644 --- a/.github/workflows/ci-xqts.yml +++ b/.github/workflows/ci-xqts.yml @@ -14,7 +14,12 @@ jobs: with: distribution: temurin java-version: '17' - cache: 'maven' + - name: Cache Maven packages + uses: actions/cache@v3 + with: + path: ~/.m2 + key: xqts-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: xqts-${{ runner.os }}-maven - name: Maven XQTS Build run: mvn -V -B clean package -DskipTests -Ddependency-check.skip=true --projects exist-xqts --also-make - name: Run XQTS diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index ef78ac3fff9..5bf1fae8822 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -23,14 +23,14 @@ jobs: uses: actions/cache@v3 with: path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar + key: sonarcloud-${{ runner.os }}-cache-${{ hashFiles('**/pom.xml') }} + restore-keys: sonarcloud-${{ runner.os }}-cache - name: Cache Maven packages uses: actions/cache@v3 with: path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 + key: sonarcloud-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: sonarcloud-${{ runner.os }}-maven - name: Analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any