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-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..e6610297737 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,8 @@ 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 - name: Upload surefire reports if: always() @@ -53,42 +54,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 -Dmaven.test.skip=true 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 help:evaluate -Dexpression=project.version -q -DforceStdout)" >> "$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..9eea3b2ff68 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 -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 9d712503a37..86dbaf40c3a 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 -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" @@ -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..2c225cf430d 100644 --- a/pom.xml +++ b/pom.xml @@ -363,12 +363,30 @@ classesAndMethods false + 4 + true true 2 **/*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 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 b83f35a8f42..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', @@ -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: {