| name: CI Build and Test |
| |
| on: |
| push: |
| pull_request: |
| workflow_dispatch: |
| |
| jobs: |
| build-and-test: |
| runs-on: ubuntu-latest |
| |
| # Increase timeout for long-running test suites |
| #timeout-minutes: 60 |
| |
| steps: |
| - name: Checkout code |
| uses: actions/checkout@v4 |
| with: |
| fetch-depth: 0 |
| |
| - name: Set up JDK 8 |
| uses: actions/setup-java@v4 |
| with: |
| java-version: '8' |
| distribution: 'temurin' |
| cache: 'maven' |
| |
| - name: Cache Maven dependencies |
| uses: actions/cache@v4 |
| with: |
| path: ~/.m2/repository |
| key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| restore-keys: | |
| ${{ runner.os }}-maven- |
| |
| - name: Configure Maven |
| run: | |
| # Create Maven options file to set memory limits for builds |
| mkdir -p .mvn |
| echo "-Xms4g -Xmx4g -XX:MaxMetaspaceSize=512m -XX:+UseG1GC" > .mvn/jvm.config |
| |
| # Set MAVEN_OPTS as backup |
| echo "MAVEN_OPTS=-Xms4g -Xmx4g -XX:MaxMetaspaceSize=512m -XX:+UseG1GC" >> $GITHUB_ENV |
| |
| - name: Build with Maven (skip tests) |
| run: mvn clean install -DskipTests -B -V |
| env: |
| MAVEN_OPTS: "-Xms4g -Xmx4g -XX:MaxMetaspaceSize=512m -XX:+UseG1GC" |
| |
| - name: Run tests with Maven |
| run: mvn clean verify -B -V |
| env: |
| MAVEN_OPTS: "-Xms4g -Xmx4g -XX:MaxMetaspaceSize=512m -XX:+UseG1GC" |
| |
| - name: Upload Test Results |
| if: always() |
| uses: actions/upload-artifact@v4 |
| with: |
| name: test-results |
| path: | |
| **/target/surefire-reports/*.xml |
| **/target/surefire-reports/*.txt |
| **/target/failsafe-reports/*.xml |
| **/target/failsafe-reports/*.txt |
| retention-days: 5 |
| |
| - name: Upload Test Logs |
| if: failure() |
| uses: actions/upload-artifact@v4 |
| with: |
| name: test-logs |
| path: | |
| **/target/surefire-reports/*.txt |
| **/target/failsafe-reports/*.txt |
| **/logs/*.log |
| retention-days: 5 |
| |
| - name: Publish Test Report |
| if: failure() |
| uses: mikepenz/action-junit-report@v4 |
| env: |
| NODE_OPTIONS: '--max-old-space-size=12288' |
| with: |
| report_paths: '**/target/*-reports/TEST-*.xml' |
| check_name: Test Results |
| fail_on_failure: true |
| require_tests: true |
| |
| - name: Upload Build Artifacts |
| if: success() |
| uses: actions/upload-artifact@v4 |
| with: |
| name: build-artifacts |
| path: | |
| phoenix-ddb-assembly/target/*.tar.gz |
| retention-days: 5 |