build(deps): Bump org.apache.maven.plugins:maven-dependency-plugin from 3.8.1 to 3.9.0 #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
| name: Build and Test | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths-ignore: | |
| - 'docs/**' | |
| pull_request: | |
| branches: [ master ] | |
| paths-ignore: | |
| - 'docs/**' | |
| concurrency: | |
| group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}" | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'cdi-unit/cdi-unit' }} | |
| defaults: | |
| run: | |
| shell: bash | |
| env: | |
| CACHE_KEY_COMMIT: build-maven-repository-${{ github.sha }} | |
| CACHE_KEY_RUN: build-maven-repository-${{ github.sha }}-${{ github.run_id }} | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| m2-monthly-branch-cache-key: ${{ steps.cache-key.outputs.m2-monthly-branch-cache-key }} | |
| m2-monthly-cache-key: ${{ steps.cache-key.outputs.m2-monthly-cache-key }} | |
| m2-cache-key: ${{ steps.cache-key.outputs.m2-cache-key }} | |
| steps: | |
| - name: Generate cache key | |
| id: cache-key | |
| run: | | |
| CURRENT_BRANCH="${{ github.repository != 'cdi-unit/cdi-unit' && 'fork' || github.base_ref || github.ref_name }}" | |
| CURRENT_MONTH=$(/bin/date -u "+%Y-%m") | |
| CURRENT_DAY=$(/bin/date -u "+%d") | |
| ROOT_CACHE_KEY="m2-cache" | |
| echo "m2-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" >> $GITHUB_OUTPUT | |
| echo "m2-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" >> $GITHUB_OUTPUT | |
| echo "m2-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" >> $GITHUB_OUTPUT | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 17 | |
| distribution: 'temurin' | |
| - name: Cache Maven Repository | |
| id: cache-maven | |
| uses: actions/cache@v4 | |
| with: | |
| enableCrossOsArchive: true | |
| path: ~/.m2/repository | |
| # A new cache will be stored daily. After that first store of the day, cache save actions will fail because the cache is immutable but it's not a problem. | |
| # The whole cache is dropped monthly to prevent unlimited growth. | |
| # The cache is per branch but in case we don't find a branch for a given branch, we will get a cache from another branch. | |
| key: ${{ steps.cache-key.outputs.m2-cache-key }} | |
| restore-keys: | | |
| ${{ steps.cache-key.outputs.m2-monthly-branch-cache-key }}- | |
| ${{ steps.cache-key.outputs.m2-monthly-cache-key }}- | |
| - name: Prepare Build | |
| run: ./ci-support/prepare-build.sh | |
| - name: Delete snapshots artifacts from cache | |
| run: find ~/.m2 -name \*-SNAPSHOT -type d -exec rm -rf {} + | |
| build: | |
| needs: prepare | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, windows-latest ] | |
| java_distribution: [ temurin, zulu ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 17 | |
| distribution: ${{ matrix.java_distribution }} | |
| - name: Restore Maven Repository | |
| uses: actions/cache/restore@v4 | |
| with: | |
| enableCrossOsArchive: true | |
| path: ~/.m2/repository | |
| key: ${{ needs.prepare.outputs.m2-cache-key }} | |
| restore-keys: | | |
| ${{ needs.prepare.outputs.m2-monthly-branch-cache-key }}- | |
| ${{ needs.prepare.outputs.m2-monthly-cache-key }}- | |
| - name: Build with Maven | |
| run: ./ci-support/build.sh | |
| - name: Tar .m2/repository/io/github/cdi-unit | |
| run: tar -czf m2-io-github-cdi-unit.tgz -C ~ .m2/repository/io/github/cdi-unit | |
| - name: Upload .m2/repository/io/github/cdi-unit | |
| if: ${{ matrix.os == 'ubuntu-latest' && matrix.java_distribution == 'temurin' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: m2-io-github-cdi-unit | |
| path: m2-io-github-cdi-unit.tgz | |
| retention-days: 7 | |
| - name: Upload failure Archive (if maven failed) | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: test-reports-${{ matrix.os }}-jdk${{ matrix.java_distribution }} | |
| path: '**/target/surefire-reports/**' | |
| - name: Delete snapshots artifacts from cache | |
| if: always() | |
| run: find ~/.m2 -name \*-SNAPSHOT -type d -exec rm -rf {} + | |
| submit-maven-dependencies: | |
| needs: [ prepare ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 17 | |
| distribution: 'temurin' | |
| - name: Restore Maven Repository | |
| uses: actions/cache/restore@v4 | |
| with: | |
| enableCrossOsArchive: true | |
| path: ~/.m2/repository | |
| key: ${{ needs.prepare.outputs.m2-cache-key }} | |
| restore-keys: | | |
| ${{ needs.prepare.outputs.m2-monthly-branch-cache-key }}- | |
| ${{ needs.prepare.outputs.m2-monthly-cache-key }}- | |
| - name: Submit Dependency Snapshot | |
| uses: advanced-security/maven-dependency-submission-action@v5 | |
| with: | |
| settings-file: .github/mvn-settings.xml | |
| maven-args: "-V -B" | |
| sonar-check: | |
| needs: [ prepare ] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: 17 | |
| distribution: 'temurin' | |
| - name: Restore Maven Repository | |
| uses: actions/cache/restore@v4 | |
| with: | |
| enableCrossOsArchive: true | |
| path: ~/.m2/repository | |
| key: ${{ needs.prepare.outputs.m2-cache-key }} | |
| restore-keys: | | |
| ${{ needs.prepare.outputs.m2-monthly-branch-cache-key }}- | |
| ${{ needs.prepare.outputs.m2-monthly-cache-key }}- | |
| - name: SonarQube Check | |
| env: | |
| MAVEN_ARGS: "-V -B --settings .github/mvn-settings.xml" | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: ./mvnw -Dno-format -Pcoverage verify sonar:sonar | |
| test-weld: | |
| needs: [ prepare, build ] | |
| uses: ./.github/workflows/test-weld.yml | |
| with: | |
| build-run-id: ${{ github.run_id }} | |
| test-deltaspike: | |
| needs: [ prepare, build ] | |
| uses: ./.github/workflows/test-deltaspike.yml | |
| with: | |
| build-run-id: ${{ github.run_id }} | |
| test-spock: | |
| needs: [ prepare, build ] | |
| uses: ./.github/workflows/test-spock.yml | |
| with: | |
| build-run-id: ${{ github.run_id }} |