Skip to content

Commit 2d93156

Browse files
authored
[OPS] Add a GitHub Action for Dumper build and testing. (#931)
- Add Dumper build & testing using GitHub actions. - Also add a 2nd Action for caching the dep graph, it came with the template. - The artifactregistry dependency was removed, because it's no longer needed and didn't work with Actions.
1 parent 5a30e69 commit 2d93156

File tree

3 files changed

+68
-2
lines changed

3 files changed

+68
-2
lines changed

.github/workflows/gradle.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
7+
8+
name: Java CI with Gradle
9+
10+
on:
11+
push:
12+
branches: [ "main" ]
13+
pull_request:
14+
branches: [ "main" ]
15+
16+
jobs:
17+
build:
18+
name: Build & test Dumper
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
23+
steps:
24+
- name: Check out
25+
uses: actions/checkout@v4
26+
27+
- name: Set up JDK
28+
uses: actions/setup-java@v4
29+
with:
30+
java-version: '11'
31+
distribution: 'temurin'
32+
33+
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
34+
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
35+
- name: Set up Gradle
36+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
37+
with:
38+
cache-cleanup: never
39+
gradle-version: '8.2.1'
40+
41+
- name: Run unit tests
42+
run: ./gradlew dumper:app:test
43+
44+
dependency-submission:
45+
name: Submit the dependency graph
46+
runs-on: ubuntu-latest
47+
permissions:
48+
contents: write
49+
steps:
50+
- name: Check out
51+
uses: actions/checkout@v4
52+
53+
- name: Set up JDK
54+
uses: actions/setup-java@v4
55+
with:
56+
java-version: '11'
57+
distribution: 'temurin'
58+
59+
- name: Set up Gradle
60+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
61+
with:
62+
cache-cleanup: never
63+
gradle-version: '8.2.1'
64+
65+
# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
66+
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
67+
- name: Generate and submit dependency graph
68+
uses: gradle/actions/dependency-submission@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

buildSrc/src/main/groovy/dwh-migration-dumper.java-common-conventions.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ plugins {
2020
id 'java-test-fixtures'
2121
id 'com.diffplug.spotless'
2222
id 'nebula.info'
23-
id 'com.google.cloud.artifactregistry.gradle-plugin'
2423
}
2524

2625
repositories {

settings.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
plugins {
22
// Apply the foojay-resolver plugin to allow automatic download of JDKs
33
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0'
4-
id "com.google.cloud.artifactregistry.gradle-plugin" version "2.2.4"
54
}
65
rootProject.name = 'dwh-migration-tools'
76
include(

0 commit comments

Comments
 (0)