Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 73 additions & 46 deletions .github/workflows/ci.yml → .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: CI
name: CI (pull_request)

on:
push:
branches: [ main, develop, 'feature/**' ]
pull_request:
branches: [ main, develop ]

Expand Down Expand Up @@ -36,33 +34,52 @@ jobs:
- name: Build and test with Maven
run: mvn -B clean verify -Pqa -Ddependency-check.skip=true

- name: Upload test results
# Upload XMLs ONLY once (Java 21) so the report doesn't double-count
- name: Upload unit test XMLs (Java 21 only)
uses: actions/upload-artifact@v4
if: always()
if: always() && matrix.java == '21'
with:
name: test-results-java-${{ matrix.java }}
name: unit-xml
path: |
**/target/surefire-reports/
**/target/failsafe-reports/
**/target/surefire-reports/TEST-*.xml
**/target/*-reports/TEST-*.xml
retention-days: 7

- name: Upload coverage report
integration-tests:
name: Integration & E2E Tests (Java ${{ matrix.java }})
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
java: [ '17', '21' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'

- name: Run integration tests
run: mvn -B clean verify -Pit -Ddependency-check.skip=true

# Upload XMLs ONLY once (Java 21) so the report doesn't double-count
- name: Upload IT test XMLs (Java 21 only)
uses: actions/upload-artifact@v4
if: matrix.java == '21'
if: always() && matrix.java == '21'
with:
name: coverage-report
name: it-xml
path: |
**/target/site/jacoco/
**/target/jacoco.exec
**/target/failsafe-reports/TEST-*.xml
retention-days: 7

- name: Publish Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: '**/target/*-reports/TEST-*.xml'
check_name: Test Report (Java ${{ matrix.java }})

quality:
name: Code Quality Analysis
runs-on: ubuntu-latest
Expand All @@ -81,32 +98,14 @@ jobs:
distribution: 'temurin'
cache: 'maven'

- name: Install artifacts for analysis
- name: Install artifacts for analysis (skip tests)
run: mvn -B -Ddependency-check.skip=true clean install -Pqa -DskipTests

- name: Run SpotBugs analysis
run: mvn -B spotbugs:check -Pqa -Ddependency-check.skip=true
continue-on-error: true

- name: Run Checkstyle analysis
run: mvn -B checkstyle:check -Pqa -Ddependency-check.skip=true
continue-on-error: true

- name: Upload SpotBugs report
uses: actions/upload-artifact@v4
if: always()
with:
name: spotbugs-report
path: '**/target/spotbugsXml.xml'
retention-days: 7

- name: Upload Checkstyle report
uses: actions/upload-artifact@v4
if: always()
with:
name: checkstyle-report
path: '**/target/checkstyle-result.xml'
retention-days: 7

dependency-check:
name: OWASP Dependency Check
Expand Down Expand Up @@ -136,13 +135,41 @@ jobs:

- name: Run OWASP Dependency Check
run: mvn -B dependency-check:aggregate -Pqa
continue-on-error: true

- name: Upload Dependency Check report
uses: actions/upload-artifact@v4
reports:
name: Test Reports
runs-on: ubuntu-latest
needs: [ build, integration-tests ]
if: always()

permissions:
contents: read
checks: write
pull-requests: write

steps:
- name: Download unit XMLs (Java 21 only)
uses: actions/download-artifact@v4
with:
name: unit-xml
path: reports/unit

- name: Download IT XMLs (Java 21 only)
uses: actions/download-artifact@v4
with:
name: it-xml
path: reports/it

- name: Publish Unit Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
name: dependency-check-report
path: |
target/dependency-check-report.html
retention-days: 30
report_paths: 'reports/unit/**/TEST-*.xml'
check_name: Unit Test Report

- name: Publish IT Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'reports/it/**/TEST-*.xml'
check_name: IT Test Report
69 changes: 69 additions & 0 deletions .github/workflows/ci-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI (push)

on:
push:
branches: [ main, develop, 'feature/**' ]

permissions:
contents: read
checks: write

jobs:
build:
name: Build & Test (Java ${{ matrix.java }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java: [ '17', '21' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'
cache: 'maven'

- name: Build and test with Maven
run: mvn -B clean verify -Pqa -Ddependency-check.skip=true

- name: Upload unit test XMLs
uses: actions/upload-artifact@v4
if: always()
with:
name: unit-xml-java-${{ matrix.java }}
path: |
**/target/surefire-reports/TEST-*.xml
**/target/*-reports/TEST-*.xml
retention-days: 7

unit-report:
name: Unit Test Report
runs-on: ubuntu-latest
needs: build
if: always()

permissions:
contents: read
checks: write

steps:
- name: Download unit XMLs (all Java versions)
uses: actions/download-artifact@v4
with:
pattern: unit-xml-java-*
merge-multiple: true
path: reports/unit

- name: Publish Unit Test Report
uses: mikepenz/action-junit-report@v4
if: always()
with:
report_paths: 'reports/unit/**/TEST-*.xml'
check_name: Unit Test Report
Loading
Loading