From 27e02e2ad52ffcc814b2d57cd11599fa80f9a499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Ko=CC=88ninger?= Date: Tue, 5 May 2026 19:44:24 +0200 Subject: [PATCH 1/5] chore(ci): optimize CI workflows for parallel builds and improve concurrency settings --- .github/workflows/build-feature.yml | 28 ++++------- .github/workflows/build-main.yml | 48 ++++++------------ .github/workflows/deploy-documentation.yml | 8 ++- .../workflows/release-to-maven-central.yml | 49 +++++-------------- pom.xml | 2 + spring-boot-admin-server-ui/vite.config.mts | 1 + 6 files changed, 44 insertions(+), 92 deletions(-) diff --git a/.github/workflows/build-feature.yml b/.github/workflows/build-feature.yml index 020ad95b9f5..db2811d2a92 100644 --- a/.github/workflows/build-feature.yml +++ b/.github/workflows/build-feature.yml @@ -8,27 +8,15 @@ on: - 2.* pull_request: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: - strategy: - matrix: - os: [ubuntu-latest] + runs-on: ubuntu-latest - runs-on: ${{ matrix.os }} steps: - - - name: free disk space - continue-on-error: true - run: | - df -h - sudo swapoff -a - sudo rm -f /swapfile - sudo apt clean - if [ -n "$(docker image ls -q)" ]; then - docker rmi -f $(docker image ls -aq) || true - fi - df -h - - uses: actions/checkout@v6 - name: Set up JDK @@ -46,8 +34,10 @@ jobs: cache: 'npm' cache-dependency-path: '**/package-lock.json' - - name: Build with Maven - run: ./mvnw -B --no-transfer-progress install -P coverage + - name: Build with Maven (parallel modules, no coverage) + run: ./mvnw -B -T 1C --no-transfer-progress install + # -T 1C = 1 thread per CPU core for parallel module builds + # Coverage skipped for faster PR feedback; main branch builds have coverage - name: Upload surefire reports if: always() diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index 26c037ffdbc..b76110293c8 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -8,13 +8,14 @@ on: - 2.* - 3.* +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: - build: - strategy: - matrix: - os: [ ubuntu-latest ] + build-and-publish: + runs-on: ubuntu-latest - runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 @@ -33,8 +34,9 @@ jobs: cache: 'npm' cache-dependency-path: '**/package-lock.json' - - name: Build with Maven - run: ./mvnw -B --no-transfer-progress install -P coverage + - name: Build with Maven (parallel modules) + run: ./mvnw -B -T 1C --no-transfer-progress install -P coverage + # -T 1C = 1 thread per CPU core for parallel module builds - name: Upload surefire reports if: always() @@ -53,42 +55,20 @@ jobs: - name: Upload coverage to Codecov uses: codecov/codecov-action@v6 - publish-snapshot: - needs: build - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v6 - - - name: Set up JDK - uses: actions/setup-java@v5 - with: - distribution: 'temurin' - java-version: '17' - cache: 'maven' - cache-dependency-path: '**/pom.xml' - - - name: Set up Node - uses: actions/setup-node@v6 - with: - node-version: '24' - cache: 'npm' - cache-dependency-path: '**/package-lock.json' - - - name: Publish SNAPSHOT version to GitHub Packages (we can skip tests, since we only deploy, if the build workflow succeeded) - run: ./mvnw -B deploy --no-transfer-progress -DskipTests + - name: Publish SNAPSHOT version to GitHub Packages + run: ./mvnw -B -T 1C deploy --no-transfer-progress -DskipTests env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Extract Maven project version for Asciidoc GitHub Pages directory naming - run: echo ::set-output name=version::$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec) + - name: Extract Maven project version + run: echo "version=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> "$GITHUB_OUTPUT" id: project - name: Show extracted Maven project version run: echo ${{ steps.project.outputs.version }} - name: Build documentation with Maven - run: ./mvnw -B --no-transfer-progress site + run: ./mvnw -B --no-transfer-progress -pl spring-boot-admin-docs site - name: Deploy documentation to GitHub Pages uses: JamesIves/github-pages-deploy-action@v4.8.0 diff --git a/.github/workflows/deploy-documentation.yml b/.github/workflows/deploy-documentation.yml index facfca301d1..025fe78e59e 100644 --- a/.github/workflows/deploy-documentation.yml +++ b/.github/workflows/deploy-documentation.yml @@ -13,6 +13,10 @@ on: type: boolean default: false +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false # Don't cancel documentation deploys in progress + env: VERSION: ${{ github.event.inputs.releaseversion }} @@ -43,8 +47,8 @@ jobs: - name: Set projects Maven version to GitHub Action GUI set version run: ./mvnw versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress - - name: Build with Maven - run: ./mvnw -B --no-transfer-progress package -DskipTests + - name: Build with Maven (parallel modules) + run: ./mvnw -B -T 1C --no-transfer-progress package -DskipTests - name: Build documentation with Maven run: ./mvnw -B --no-transfer-progress -pl spring-boot-admin-docs site diff --git a/.github/workflows/release-to-maven-central.yml b/.github/workflows/release-to-maven-central.yml index 9d712503a37..76f2e0ee249 100644 --- a/.github/workflows/release-to-maven-central.yml +++ b/.github/workflows/release-to-maven-central.yml @@ -12,6 +12,10 @@ on: type: boolean default: false +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: false # Don't cancel releases in progress + env: VERSION: ${{ github.event.inputs.releaseversion }} @@ -21,18 +25,6 @@ jobs: steps: - run: echo "Will start a Maven Central upload with version ${{ github.event.inputs.releaseversion }}" - - name: free disk space - continue-on-error: true - run: | - df -h - sudo swapoff -a - sudo rm -f /swapfile - sudo apt clean - if [ -n "$(docker image ls -q)" ]; then - docker rmi -f $(docker image ls -aq) || true - fi - df -h - - uses: actions/checkout@v6 - name: Set up settings.xml for Maven Central Repository @@ -51,21 +43,18 @@ jobs: MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }} MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - - name: Cache node modules - uses: actions/cache@v5 - env: - cache-name: cache-node-modules + - name: Set up Node + uses: actions/setup-node@v6 with: - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- + node-version: '24' + cache: 'npm' + cache-dependency-path: '**/package-lock.json' - name: Set projects Maven version to GitHub Action GUI set version run: ./mvnw versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress - - name: Publish package - run: ./mvnw -B deploy --no-transfer-progress -P central-deploy -DskipTests + - name: Publish package (parallel modules) + run: ./mvnw -B -T 1C deploy --no-transfer-progress -P central-deploy -DskipTests env: #TODO: This is a workaround for NEXUS-27902 which uses XStream that fails on JVM >16 JDK_JAVA_OPTIONS: "--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED" @@ -74,7 +63,7 @@ jobs: MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - name: Build documentation with Maven - run: ./mvnw -B --no-transfer-progress -pl spring-boot-admin-docs site + run: ./mvnw -B --no-transfer-progress -pl spring-boot-admin-docs site - name: Deploy documentation to GitHub Pages for version ${{ github.event.inputs.releaseversion }} uses: JamesIves/github-pages-deploy-action@v4.8.0 @@ -109,18 +98,6 @@ jobs: steps: - uses: actions/checkout@v6 - - name: free disk space - continue-on-error: true - run: | - df -h - sudo swapoff -a - sudo rm -f /swapfile - sudo apt clean - if [ -n "$(docker image ls -q)" ]; then - docker rmi -f $(docker image ls -aq) || true - fi - df -h - - name: Generate changelog id: changelog uses: metcalfc/changelog-generator@v4.7.0 @@ -135,5 +112,3 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} draft: false prerelease: ${{ contains(github.event.inputs.releaseversion, '-') }} - - diff --git a/pom.xml b/pom.xml index 8c2094d2d87..b6fb1bbb007 100644 --- a/pom.xml +++ b/pom.xml @@ -363,6 +363,8 @@ classesAndMethods false + 4 + true true 2 diff --git a/spring-boot-admin-server-ui/vite.config.mts b/spring-boot-admin-server-ui/vite.config.mts index b83f35a8f42..0fc58083121 100644 --- a/spring-boot-admin-server-ui/vite.config.mts +++ b/spring-boot-admin-server-ui/vite.config.mts @@ -60,6 +60,7 @@ export default defineConfig(({ mode }) => { TZ: 'Europe/Berlin', }, include: ['**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], + maxWorkers: 4, }, root: frontendDir, build: { From fba4df2e90b504150033d1b88a6f9e196f2915f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Ko=CC=88ninger?= Date: Tue, 5 May 2026 20:49:13 +0200 Subject: [PATCH 2/5] chore(ci): update test environment from jsdom to happy-dom for improved performance --- .../frontend/views/instances/sbomdependencytrees/tree.spec.ts | 3 +++ spring-boot-admin-server-ui/vite.config.mts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/sbomdependencytrees/tree.spec.ts b/spring-boot-admin-server-ui/src/main/frontend/views/instances/sbomdependencytrees/tree.spec.ts index 0f161035134..0fb36b0c21c 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/sbomdependencytrees/tree.spec.ts +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/sbomdependencytrees/tree.spec.ts @@ -1,3 +1,6 @@ +/** + * @vitest-environment jsdom + */ import { RenderResult, screen, waitFor } from '@testing-library/vue'; import { beforeEach, describe, expect, it, vi } from 'vitest'; diff --git a/spring-boot-admin-server-ui/vite.config.mts b/spring-boot-admin-server-ui/vite.config.mts index 0fc58083121..cb661889342 100644 --- a/spring-boot-admin-server-ui/vite.config.mts +++ b/spring-boot-admin-server-ui/vite.config.mts @@ -52,7 +52,7 @@ export default defineConfig(({ mode }) => { test: { root: __dirname, globals: true, - environment: 'jsdom', + environment: 'happy-dom', // Faster than jsdom (~2-3x) setupFiles: [resolve(frontendDir, 'tests/setup.ts')], env: { LANG: 'de_DE.UTF-8', From 1894d2beb4d44b0006531558ec5fb6f876ddd0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Ko=CC=88ninger?= Date: Wed, 6 May 2026 07:18:38 +0200 Subject: [PATCH 3/5] chore(ci): update Maven Failsafe plugin configuration to refine test inclusions and exclusions --- pom.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pom.xml b/pom.xml index b6fb1bbb007..2c225cf430d 100644 --- a/pom.xml +++ b/pom.xml @@ -371,6 +371,22 @@ **/*Tests.java **/*Test.java + + **/*IntegrationTests.java + **/*IntegrationTest.java + **/Abstract*.java + + + + + org.apache.maven.plugins + maven-failsafe-plugin + ${maven-failsafe-plugin.version} + + + **/*IntegrationTest.java + **/*IntegrationTests.java + **/Abstract*.java From d2d489903a58b905c9c6678475c73ba5f03eecec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Ko=CC=88ninger?= Date: Wed, 6 May 2026 07:23:46 +0200 Subject: [PATCH 4/5] chore(ci): update Maven commands to use -Dmaven.test.skip=true for consistency --- .github/copilot-instructions.md | 10 +++++----- .github/workflows/build-main.yml | 3 +-- .github/workflows/deploy-documentation.yml | 2 +- .github/workflows/release-to-maven-central.yml | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index f792ef84ed5..1446a996ebd 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -15,9 +15,9 @@ Always reference these instructions first and fallback to search or bash command ### Building the Project - **NEVER CANCEL builds - they take time but will complete successfully** - **CRITICAL**: Set timeout to 20+ minutes for builds, 60+ minutes for tests -- Clean compile: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ./mvnw clean compile -B --no-transfer-progress -DskipTests` -- takes ~10.5 minutes -- Full package: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ./mvnw package -B --no-transfer-progress -DskipTests` -- takes ~4 minutes -- Install to local repository: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ./mvnw install -B --no-transfer-progress -DskipTests` -- takes ~1.5 minutes +- Clean compile: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ./mvnw clean compile -B --no-transfer-progress -Dmaven.test.skip=true` -- takes ~10.5 minutes +- Full package: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ./mvnw package -B --no-transfer-progress -Dmaven.test.skip=true` -- takes ~4 minutes +- Install to local repository: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH" && ./mvnw install -B --no-transfer-progress -Dmaven.test.skip=true` -- takes ~1.5 minutes ### Testing - **NEVER CANCEL test runs - set 60+ minute timeouts** @@ -101,7 +101,7 @@ Always reference these instructions first and fallback to search or bash command ## Development Workflow 1. **Setup**: Configure Node.js 22.18.0 in PATH: `export PATH="/tmp/node-v22.18.0-linux-x64/bin:$PATH"` 2. **Initial Build**: Run `./mvnw clean compile` to verify everything builds (~10.5 minutes - be patient) -3. **Install Dependencies**: Run `./mvnw install -DskipTests` for sample app dependencies (~1.5 minutes) +3. **Install Dependencies**: Run `./mvnw install -Dmaven.test.skip=true` for sample app dependencies (~1.5 minutes) 4. **Make Changes**: Edit code in appropriate modules 5. **Format Code**: Run `./mvnw spring-javaformat:apply` and UI `npm run format:fix` 6. **Test Build**: Run build commands to verify changes don't break anything @@ -146,4 +146,4 @@ spring-boot-admin/ # Root project (19 modules) ├── spring-boot-admin-starter-*/ # Spring Boot auto-configuration ├── mvnw # Maven wrapper └── pom.xml # Root Maven configuration -``` \ No newline at end of file +``` diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index b76110293c8..ef5124acd4e 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -36,7 +36,6 @@ jobs: - name: Build with Maven (parallel modules) run: ./mvnw -B -T 1C --no-transfer-progress install -P coverage - # -T 1C = 1 thread per CPU core for parallel module builds - name: Upload surefire reports if: always() @@ -56,7 +55,7 @@ jobs: uses: codecov/codecov-action@v6 - name: Publish SNAPSHOT version to GitHub Packages - run: ./mvnw -B -T 1C deploy --no-transfer-progress -DskipTests + run: ./mvnw -B -T 1C deploy --no-transfer-progress -Dmaven.test.skip=true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/deploy-documentation.yml b/.github/workflows/deploy-documentation.yml index 025fe78e59e..9eea3b2ff68 100644 --- a/.github/workflows/deploy-documentation.yml +++ b/.github/workflows/deploy-documentation.yml @@ -48,7 +48,7 @@ jobs: run: ./mvnw versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress - name: Build with Maven (parallel modules) - run: ./mvnw -B -T 1C --no-transfer-progress package -DskipTests + run: ./mvnw -B -T 1C --no-transfer-progress package -Dmaven.test.skip=true - name: Build documentation with Maven run: ./mvnw -B --no-transfer-progress -pl spring-boot-admin-docs site diff --git a/.github/workflows/release-to-maven-central.yml b/.github/workflows/release-to-maven-central.yml index 76f2e0ee249..86dbaf40c3a 100644 --- a/.github/workflows/release-to-maven-central.yml +++ b/.github/workflows/release-to-maven-central.yml @@ -54,7 +54,7 @@ jobs: run: ./mvnw versions:set "-DnewVersion=${{ github.event.inputs.releaseversion }}" --no-transfer-progress - name: Publish package (parallel modules) - run: ./mvnw -B -T 1C deploy --no-transfer-progress -P central-deploy -DskipTests + run: ./mvnw -B -T 1C deploy --no-transfer-progress -P central-deploy -Dmaven.test.skip=true env: #TODO: This is a workaround for NEXUS-27902 which uses XStream that fails on JVM >16 JDK_JAVA_OPTIONS: "--add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED" From 11d40eb99f9dc658e7d014f05ab731ac30aac4a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Ko=CC=88ninger?= Date: Wed, 6 May 2026 07:23:54 +0200 Subject: [PATCH 5/5] chore(ci): update Maven command to extract project version using help:evaluate for accuracy --- .github/workflows/build-main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index ef5124acd4e..e6610297737 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -60,7 +60,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Extract Maven project version - run: echo "version=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> "$GITHUB_OUTPUT" + run: echo "version=$(./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$GITHUB_OUTPUT" id: project - name: Show extracted Maven project version