Skip to content

Commit

Permalink
Adding GitHub workflow for testing (#17)
Browse files Browse the repository at this point in the history
* Create .github/workflows/gradle-publish.yml

* Create file if not exist
  • Loading branch information
thomas-bc authored Mar 14, 2023
1 parent 50d7c07 commit 18d4d3f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/gradle-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Gradle Build and Test

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: testAll
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ def defineTargetTestingTask(String taskName, String targetType, String inputFile
dependsOn "execute${taskName}Target"
group = "DiffTesting"
description = "Test the ${targetType} target by comparing its output with the reference output."
new File("${TEST_OUTPUT_PATH}").mkdirs()
def outputFilename = "${TEST_OUTPUT_PATH}/${taskName}.difflog"
standardOutput = new FileOutputStream(outputFilename)
commandLine "diff", "-rb", "${TEST_OUTPUT_PATH}/${taskName}", "${expectedOutputPath}"
Expand Down Expand Up @@ -127,4 +128,4 @@ task testAll {
println "[PASS] All tests succeeded."
}
}
}
}

0 comments on commit 18d4d3f

Please sign in to comment.