Add Spring Boot Actuator for health endpoint #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will build a Java / Kotlin project with Maven, and cache/restore any dependencies to improve the workflow execution time | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
| name: Build | |
| on: | |
| push: | |
| pull_request: | |
| types: [ opened, synchronize, reopened ] | |
| # Required for dorny/test-reporter to create check runs | |
| permissions: | |
| contents: read | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| cache: maven | |
| - name: Configure Testcontainers | |
| run: | | |
| mkdir -p /home/runner | |
| echo "testcontainers.reuse.enable=true" > /home/runner/.testcontainers.properties | |
| - name: Configure Maven Settings | |
| uses: s4u/maven-settings-action@v2.8.0 | |
| with: | |
| servers: ${{secrets.EMBABEL_ARTIFACTORY}} | |
| # Compile first - fail fast on compilation errors | |
| # -U forces update of SNAPSHOT dependencies | |
| - name: Compile | |
| run: mvn -U -B compile test-compile | |
| # Run tests with JaCoCo coverage | |
| - name: Test with Coverage | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_DUMMY_KEY }} | |
| run: mvn -U -B test | |
| # Generate JaCoCo coverage report | |
| - name: Generate Coverage Report | |
| if: always() | |
| run: mvn -U -B jacoco:report | |
| continue-on-error: true | |
| # Publish test results as check run annotations | |
| - name: Publish Test Results | |
| uses: dorny/test-reporter@v1 | |
| if: always() && github.ref == 'refs/heads/main' | |
| with: | |
| name: Test Results | |
| path: target/surefire-reports/*.xml | |
| reporter: java-junit | |
| fail-on-error: false | |
| # Upload test reports as artifacts | |
| - name: Upload Test Reports | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: test-reports | |
| path: | | |
| target/surefire-reports/ | |
| target/site/jacoco/ | |
| retention-days: 14 | |
| # Upload coverage to Codecov (optional - requires CODECOV_TOKEN secret) | |
| - name: Upload Coverage to Codecov | |
| uses: codecov/codecov-action@v4 | |
| if: always() | |
| continue-on-error: true | |
| with: | |
| files: target/site/jacoco/jacoco.xml | |
| fail_ci_if_error: false |