chore(deps): update spring boot to v3.5.12 (#106) #549
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 project with Maven | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | |
| name: Java CI with Maven | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| repository_dispatch: | |
| types: contracts changed | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| os: [ ubuntu-latest ] | |
| java: [ 17 ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Set up JDK ${{ matrix.java }} | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: 'temurin' | |
| java-version: ${{ matrix.java }} | |
| - name: Setup Maven Action | |
| uses: s4u/setup-maven-action@v1.19.0 | |
| with: | |
| checkout-enabled: false | |
| - name: Download Specmatic CLI | |
| run: | | |
| mkdir -p ~/.specmatic | |
| if [ ! -f ~/.specmatic/specmatic.jar ]; then | |
| echo "Downloading latest specmatic.jar from GitHub releases" | |
| curl -L -f -o ~/.specmatic/specmatic.jar https://github.com/specmatic/specmatic/releases/latest/download/specmatic.jar | |
| else | |
| echo "specmatic.jar already exists, skipping download" | |
| fi | |
| - name: Save Specmatic license | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| mkdir -p ~/.specmatic | |
| echo "${{ secrets.SPECMATIC_LICENSE_KEY }}" > ~/.specmatic/specmatic-license.txt | |
| - name: Build with Maven | |
| run: ./mvnw --no-transfer-progress test package jacoco:report -Ptest | |
| - name: Publish Build Reports to Specmatic Insights | |
| if: github.ref == 'refs/heads/main' | |
| run: | | |
| docker run \ | |
| -v ${{ github.workspace }}:/usr/src/app \ | |
| -v ~/.specmatic:/root/.specmatic \ | |
| specmatic/specmatic \ | |
| send-report \ | |
| --metadata build_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} \ | |
| --branch-name ${{ github.ref_name }} \ | |
| --repo-name ${{ github.event.repository.name }} \ | |
| --repo-id ${{ github.repository_id }} \ | |
| --repo-url ${{ github.event.repository.html_url }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: jacoco coverage report | |
| path: /home/runner/work/specmatic-order-api/specmatic-order-api/target/site/jacoco | |
| - name: Upload HTML Test Report | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: ${{ matrix.os }}-${{ matrix.java }}-html-report | |
| path: build/reports/specmatic/html | |
| - name: Upload target jar for Docker | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: jar | |
| path: target/*.jar | |
| docker: | |
| if: github.ref == 'refs/heads/main' | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Download target jar from build job | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: jar | |
| path: target/ | |
| - name: List files in target directory | |
| run: ls -la target/ | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Docker Login | |
| run: echo ${{ secrets.SPECMATIC_DOCKER_HUB_TOKEN }} | docker login -u ${{ vars.SPECMATIC_DOCKER_HUB_USERNAME }} --password-stdin | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: specmaticdemo/${{ github.event.repository.name }} | |
| - name: Build and push Docker image (multi-platform) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| specmaticdemo/${{ github.event.repository.name }}:latest | |
| labels: ${{ steps.meta.outputs.labels }} |