From 8d65773edd2cfeefeeabc5180295310f61259571 Mon Sep 17 00:00:00 2001 From: Christopher Schmitz Date: Tue, 26 Dec 2023 21:21:44 -0600 Subject: [PATCH 1/3] Adds gradle action --- .github/workflows/gradle.yml | 33 +++++++++++++++++++++++++++++++++ gradle.properties | 1 - 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/gradle.yml delete mode 100644 gradle.properties diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..457f647 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,33 @@ +# 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: + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v3 + with: + java-version: '17' + distribution: 'temurin' + - name: Build with Gradle + uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0 + with: + arguments: build diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index faac9d6..0000000 --- a/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -org.gradle.java.home=/Users/scch1001/.sdkman/candidates/java/current \ No newline at end of file From 12e7a70fa3139f16325ac6bd36d7d7d864d35a00 Mon Sep 17 00:00:00 2001 From: Christopher Schmitz Date: Tue, 26 Dec 2023 21:42:19 -0600 Subject: [PATCH 2/3] Adds test configurations to get better failure explanations --- build.gradle.kts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 493f894..8af93da 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ import groovy.lang.MissingPropertyException +import org.gradle.api.tasks.testing.logging.TestExceptionFormat import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -44,8 +45,20 @@ tasks.withType { tasks.withType { useJUnitPlatform() + testLogging { + events("passed", "skipped", "failed") + + showExceptions = true + exceptionFormat = TestExceptionFormat.FULL + showCauses = true + showStackTraces = true + + showStandardStreams = false + } } + + tasks { val dockerComposeUp by creating(Task::class) { description = "Builds app, spins up docker containers, and launches the API." From 8ee67d7e14b1b3dd496e54ed35a12028c0fc9880 Mon Sep 17 00:00:00 2001 From: Christopher Schmitz Date: Tue, 26 Dec 2023 21:55:50 -0600 Subject: [PATCH 3/3] simplifies action event trigger --- .github/workflows/gradle.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 457f647..c3e0ce0 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -7,10 +7,7 @@ name: Java CI with Gradle -on: - push: - pull_request: - branches: [ "main" ] +on: [ "push" ] permissions: contents: read @@ -19,7 +16,6 @@ jobs: build: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - name: Set up JDK 17