diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 000000000..eccd6732d --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,68 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +# This workflow will build a Java project with Gradle 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-gradle + +name: Java CI with Gradle + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + name: Build & test Dumper + runs-on: ubuntu-latest + permissions: + contents: read + + steps: + - name: Check out + uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + + # Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies. + # See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md + - name: Set up Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + with: + cache-cleanup: never + gradle-version: '8.2.1' + + - name: Run unit tests + run: ./gradlew dumper:app:test + + dependency-submission: + name: Submit the dependency graph + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Check out + uses: actions/checkout@v4 + + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'temurin' + + - name: Set up Gradle + uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 + with: + cache-cleanup: never + gradle-version: '8.2.1' + + # Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies. + # See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md + - name: Generate and submit dependency graph + uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0 diff --git a/buildSrc/src/main/groovy/dwh-migration-dumper.java-common-conventions.gradle b/buildSrc/src/main/groovy/dwh-migration-dumper.java-common-conventions.gradle index 8d6ed4d57..a51ebce91 100644 --- a/buildSrc/src/main/groovy/dwh-migration-dumper.java-common-conventions.gradle +++ b/buildSrc/src/main/groovy/dwh-migration-dumper.java-common-conventions.gradle @@ -20,7 +20,6 @@ plugins { id 'java-test-fixtures' id 'com.diffplug.spotless' id 'nebula.info' - id 'com.google.cloud.artifactregistry.gradle-plugin' } repositories { diff --git a/settings.gradle b/settings.gradle index 76997e41d..59c741e51 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,7 +1,6 @@ plugins { // Apply the foojay-resolver plugin to allow automatic download of JDKs id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' - id "com.google.cloud.artifactregistry.gradle-plugin" version "2.2.4" } rootProject.name = 'dwh-migration-tools' include(