Bump the build-dependencies group across 1 directory with 3 updates #40
Workflow file for this run
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: GH Actions CI | |
| on: | |
| push: | |
| branches: | |
| # Pattern order matters: the last matching inclusion/exclusion wins | |
| - 'main' | |
| # We don't want to run CI on branches for dependabot, just on the PR. | |
| - '!dependabot/**' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| # Ignore dependabot PRs that are not just about build dependencies or workflows; | |
| # we'll reject such PRs and send one ourselves. | |
| - '!dependabot/**' | |
| - 'dependabot/maven/build-dependencies-**' | |
| - 'dependabot/github_actions/workflow-actions-**' | |
| permissions: { } # none | |
| # See https://github.com/hibernate/hibernate-orm/pull/4615 for a description of the behavior we're getting. | |
| concurrency: | |
| # Consider that two builds are in the same concurrency group (cannot run concurrently) | |
| # if they use the same workflow and are about the same branch ("ref") or pull request. | |
| group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}" | |
| # Cancel previous builds in the same concurrency group even if they are in progress | |
| # for pull requests or pushes to forks (not the upstream repository). | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' || github.repository != 'hibernate/hibernate-nosql' }} | |
| env: | |
| COMMON_GRADLE_ARGS: "-Igradle/init.gradle" | |
| MIRROR_MAVEN_CENTRAL_URL: "https://maven-central.storage-download.googleapis.com/maven2/" | |
| MIRROR_MAVEN_CENTRAL_FALLBACK: "true" | |
| jobs: | |
| # Main job | |
| build: | |
| permissions: | |
| contents: read | |
| name: OpenJDK 25 - ${{matrix.rdbms}} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # This is just a sanity check for the compilation and JNoSQL implementation | |
| - rdbms: h2 | |
| - rdbms: neo4j | |
| - rdbms: milvus_2_6 | |
| - rdbms: milvus_3_0 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Reclaim Disk Space | |
| run: .github/ci-prerequisites.sh | |
| - name: Start database | |
| env: | |
| RDBMS: ${{ matrix.rdbms }} | |
| run: ci/database-start.sh | |
| - name: Set up Java 25 | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '25' | |
| - name: Generate cache key | |
| id: cache-key | |
| env: | |
| CURRENT_BRANCH: ${{ github.repository != 'hibernate/hibernate-nosql' && 'fork' || github.base_ref || github.ref_name }} | |
| run: | | |
| CURRENT_MONTH=$(/bin/date -u "+%Y-%m") | |
| CURRENT_DAY=$(/bin/date -u "+%d") | |
| ROOT_CACHE_KEY="buildtool-cache" | |
| { | |
| echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" | |
| echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" | |
| echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Cache Maven/Gradle Dependency/Dist Caches | |
| id: cache-maven | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| # if it's not a pull request, we restore and save the cache | |
| if: github.event_name != 'pull_request' | |
| with: | |
| path: | | |
| ~/.m2/repository/ | |
| ~/.m2/wrapper/ | |
| ~/.gradle/caches/ | |
| !~/.gradle/caches/build-cache-* | |
| ~/.gradle/wrapper/ | |
| # 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.buildtool-cache-key }} | |
| restore-keys: | | |
| ${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}- | |
| ${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}- | |
| - name: Restore Maven/Gradle Dependency/Dist Caches | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| # if it is a pull request, we restore the cache, but we don't save it | |
| if: github.event_name == 'pull_request' | |
| with: | |
| path: | | |
| ~/.m2/repository/ | |
| ~/.m2/wrapper/ | |
| ~/.gradle/caches/ | |
| !~/.gradle/caches/build-cache-* | |
| ~/.gradle/wrapper/ | |
| key: ${{ steps.cache-key.outputs.buildtool-cache-key }} | |
| restore-keys: | | |
| ${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}- | |
| ${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}- | |
| - name: Run build script | |
| run: | | |
| read -ra common_gradle_args <<< "$COMMON_GRADLE_ARGS" | |
| ./ci/build-github.sh "${common_gradle_args[@]}" | |
| shell: bash | |
| env: | |
| RDBMS: ${{ matrix.rdbms }} | |
| JPA_PREVIEW: "true" | |
| # For jobs running on 'push', publish build scan and cache immediately. | |
| # This won't work for pull requests, since they don't have access to secrets. | |
| POPULATE_REMOTE_GRADLE_CACHE: ${{ github.event_name == 'push' && github.repository == 'hibernate/hibernate-nosql' && 'true' || 'false' }} | |
| DEVELOCITY_ACCESS_KEY: "${{ secrets.DEVELOCITY_ACCESS_KEY }}" | |
| # For jobs running on 'pull_request', upload build scan data. | |
| # The actual publishing must be done in a separate job (see ci-report.yml). | |
| # We don't write to the remote cache as that would be unsafe. | |
| - name: Upload GitHub Actions artifact for the Develocity build scan | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: "${{ github.event_name == 'pull_request' && !cancelled() }}" | |
| with: | |
| name: build-scan-data-${{ matrix.rdbms }} | |
| path: ~/.gradle/build-scan-data | |
| - name: Store coverage report | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: build-coverage-data-${{ matrix.rdbms }} | |
| retention-days: 1 | |
| path: | | |
| ./**/target/jacoco/*.exec | |
| - name: Store build results | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: "${{ matrix.rdbms == 'h2' }}" | |
| with: | |
| name: build-compilation-data | |
| retention-days: 1 | |
| path: | | |
| ./**/target/resources/ | |
| ./**/target/classes/ | |
| ./**/target/generated/ | |
| .gradle/caches/build-cache-* | |
| - name: Upload docs preview | |
| if: "${{ matrix.rdbms == 'h2' }}" | |
| uses: hibernate/.github/actions/build-docs-preview@3557603173bed679b6b8e73add161d31c87793b6 # main | |
| with: | |
| dist-path: 'documentation/target/asciidoc' | |
| src-paths: | | |
| documentation/src | |
| migration-guide.adoc | |
| dialects.adoc | |
| whats-new.adoc | |
| - name: Upload test reports (if Gradle failed) | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: failure() | |
| with: | |
| name: test-reports-java11-${{ matrix.rdbms }} | |
| path: | | |
| ./**/target/reports/tests/ | |
| - name: Omit produced artifacts from build cache | |
| run: ./ci/before-cache.sh | |
| # Static code analysis check | |
| format_checks: | |
| permissions: | |
| contents: read | |
| name: Static code analysis | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Reclaim disk space and sanitize user home | |
| run: .github/ci-prerequisites-atlas.sh | |
| - name: Set up Java 25 | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '25' | |
| - name: Generate cache key | |
| id: cache-key | |
| env: | |
| CURRENT_BRANCH: ${{ github.repository != 'hibernate/hibernate-nosql' && 'fork' || github.base_ref || github.ref_name }} | |
| run: | | |
| CURRENT_MONTH=$(/bin/date -u "+%Y-%m") | |
| CURRENT_DAY=$(/bin/date -u "+%d") | |
| ROOT_CACHE_KEY="buildtool-cache" | |
| { | |
| echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" | |
| echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" | |
| echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Cache Maven/Gradle Dependency/Dist Caches | |
| id: cache-maven | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| # if it's not a pull request, we restore and save the cache | |
| if: github.event_name != 'pull_request' | |
| with: | |
| path: | | |
| ~/.m2/repository/ | |
| ~/.m2/wrapper/ | |
| ~/.gradle/caches/ | |
| !~/.gradle/caches/build-cache-* | |
| ~/.gradle/wrapper/ | |
| # 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.buildtool-cache-key }} | |
| restore-keys: | | |
| ${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}- | |
| ${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}- | |
| - name: Restore Maven/Gradle Dependency/Dist Caches | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| # if it is a pull request, we restore the cache, but we don't save it | |
| if: github.event_name == 'pull_request' | |
| with: | |
| path: | | |
| ~/.m2/repository/ | |
| ~/.m2/wrapper/ | |
| ~/.gradle/caches/ | |
| !~/.gradle/caches/build-cache-* | |
| ~/.gradle/wrapper/ | |
| key: ${{ steps.cache-key.outputs.buildtool-cache-key }} | |
| restore-keys: | | |
| ${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}- | |
| ${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}- | |
| - name: Run build script | |
| run: | | |
| read -ra common_gradle_args <<< "$COMMON_GRADLE_ARGS" | |
| ./gradlew "${common_gradle_args[@]}" formatChecks | |
| env: | |
| JPA_PREVIEW: "true" | |
| # For jobs running on 'push', publish build scan and cache immediately. | |
| # This won't work for pull requests, since they don't have access to secrets. | |
| POPULATE_REMOTE_GRADLE_CACHE: ${{ github.event_name == 'push' && github.repository == 'hibernate/hibernate-nosql' && 'true' || 'false' }} | |
| DEVELOCITY_ACCESS_KEY: "${{ secrets.DEVELOCITY_ACCESS_KEY }}" | |
| # For jobs running on 'pull_request', upload build scan data. | |
| # The actual publishing must be done in a separate job (see ci-report.yml). | |
| # We don't write to the remote cache as that would be unsafe. | |
| - name: Upload GitHub Actions artifact for the Develocity build scan | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: "${{ github.event_name == 'pull_request' && !cancelled() }}" | |
| with: | |
| name: build-scan-data-sca | |
| path: ~/.gradle/build-scan-data | |
| - name: Upload test reports (if Gradle failed) | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: failure() | |
| with: | |
| name: test-reports-java11-sca | |
| path: | | |
| ./**/target/reports/tests/ | |
| - name: Omit produced artifacts from build cache | |
| run: ./ci/before-cache.sh | |
| prepare-sonar-bundle: | |
| name: Prepare build bundle for Sonar scanner | |
| needs: | |
| - build | |
| if: | | |
| always() && !cancelled() | |
| && needs.build.result != 'cancelled' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@03ad4de0992f5dab5e18fcb136590ce7c4a0ac95 # v5.6.0 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| - name: Generate cache key | |
| id: cache-key | |
| env: | |
| CURRENT_BRANCH: ${{ github.repository != 'hibernate/hibernate-nosql' && 'fork' || github.base_ref || github.ref_name }} | |
| run: | | |
| CURRENT_MONTH=$(/bin/date -u "+%Y-%m") | |
| CURRENT_DAY=$(/bin/date -u "+%d") | |
| ROOT_CACHE_KEY="buildtool-cache" | |
| { | |
| echo "buildtool-monthly-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}" | |
| echo "buildtool-monthly-branch-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}" | |
| echo "buildtool-cache-key=${ROOT_CACHE_KEY}-${CURRENT_MONTH}-${CURRENT_BRANCH}-${CURRENT_DAY}" | |
| } >> "$GITHUB_OUTPUT" | |
| - name: Restore Maven/Gradle Dependency/Dist Caches | |
| uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: | | |
| ~/.m2/repository/ | |
| ~/.m2/wrapper/ | |
| ~/.gradle/caches/ | |
| !~/.gradle/caches/build-cache-* | |
| ~/.gradle/wrapper/ | |
| key: ${{ steps.cache-key.outputs.buildtool-cache-key }} | |
| restore-keys: | | |
| ${{ steps.cache-key.outputs.buildtool-monthly-branch-cache-key }}- | |
| ${{ steps.cache-key.outputs.buildtool-monthly-cache-key }}- | |
| - name: Download compilation results | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1 | |
| with: | |
| name: build-compilation-data | |
| path: . | |
| # Don't fail the build if there are no matching artifacts (the build will re-compile things then) | |
| continue-on-error: true | |
| - name: Download coverage reports | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # 8.0.1 | |
| with: | |
| pattern: build-coverage-data* | |
| path: . | |
| merge-multiple: 'true' | |
| # Don't fail the build if there are no matching artifacts | |
| continue-on-error: true | |
| - name: Merge Jacoco Reports | |
| run: | | |
| read -ra common_gradle_args <<< "$COMMON_GRADLE_ARGS" | |
| ./gradlew "${common_gradle_args[@]}" mergeCodeCoverageReport copyDependenciesSonar --no-parallel | |
| env: | |
| JPA_PREVIEW: "true" | |
| - name: Store build info for Sonar scanning | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: build-results-data | |
| retention-days: 1 | |
| path: | | |
| ./**/target/jacoco/*.exec | |
| ./**/target/classes/ | |
| ./**/target/generated/ | |
| ./**/target/resources/ | |
| ./**/target/reports/ | |
| ./**/target/sonar-dependencies/ |