Bump com.sap.cloud.environment.servicebinding:java-modules-bom (#40) #58
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 builds and tests the Javalin Shopping sample | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven | |
| name: Javalin Shopping sample | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "**" ] | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| detect-changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_run: ${{ steps.changed.outputs.any_modified }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Detect changed files | |
| id: changed | |
| uses: tj-actions/changed-files@v46 | |
| with: | |
| files: | | |
| ams-javalin-shopping/pom.xml | |
| ams-javalin-shopping/src/** | |
| .github/workflows/build_and_test_javalin.yml | |
| maven: | |
| name: Build and Test | |
| needs: detect-changes | |
| if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.should_run == 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| cache: 'maven' | |
| cache-dependency-path: ams-javalin-shopping/pom.xml | |
| - name: Build and Test | |
| run: mvn clean test | |
| working-directory: ams-javalin-shopping | |
| # This job ensures the workflow passes when no relevant changes are detected | |
| # Required for PR status checks to pass when the sample hasn't changed | |
| no-changes: | |
| name: Build and Test | |
| needs: detect-changes | |
| if: ${{ github.event_name != 'workflow_dispatch' && needs.detect-changes.outputs.should_run != 'true' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: No relevant changes detected | |
| run: echo "No relevant changes detected for ams-javalin-shopping. Skipping build and test." |