From b9a976b3a9eba0a706be0ce0711af108c2c64786 Mon Sep 17 00:00:00 2001 From: MartinWitt Date: Sun, 2 Jan 2022 23:09:15 +0100 Subject: [PATCH] chore(CI): add gradle build to tests (#19) --- .github/workflows/tests.yml | 25 +++++++++++++++++++ code-transformation/build.gradle | 2 +- .../spoon/code_solver/JunitTests.java | 4 +-- 3 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 000000000..af29f702a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,25 @@ +name: Java CI with Gradle + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 + + - name: Execute Gradle build + run: ./gradlew build \ No newline at end of file diff --git a/code-transformation/build.gradle b/code-transformation/build.gradle index cc25834d9..0f516f4cc 100644 --- a/code-transformation/build.gradle +++ b/code-transformation/build.gradle @@ -60,7 +60,7 @@ spotless { greclipse() } java { - eclipse().configFile('/src/main/resources/formatter-settings.xml') + eclipse().configFile(projectDir.toString() +'/src/main/resources/formatter-settings.xml') } allprojects { repositories { diff --git a/code-transformation/src/test/java/xyz/keksdose/spoon/code_solver/JunitTests.java b/code-transformation/src/test/java/xyz/keksdose/spoon/code_solver/JunitTests.java index 191636908..aa229666b 100644 --- a/code-transformation/src/test/java/xyz/keksdose/spoon/code_solver/JunitTests.java +++ b/code-transformation/src/test/java/xyz/keksdose/spoon/code_solver/JunitTests.java @@ -59,7 +59,7 @@ public void printerDoesNotCrash(@TempDir File tempRoot) throws IOException { String resourcePath = "projects/bugs/AnnotationValuesTest.java"; File copy = TestHelper.createCopy(tempRoot, resourcePath, fileName); List transformations = createProcessorSupplier(v -> new TestAnnotation(v), - v -> new AssertionsTransformation(v)); + v -> new AssertionsTransformation(v)); new TransformationHelper.Builder().path(tempRoot.getAbsolutePath()) .className("AnnotationValuesTest") .processors(transformations) @@ -77,7 +77,7 @@ public void printerDoesNotIncludeWhiteSpaceInInvocations(@TempDir File tempRoot) String resourcePath = "projects/bugs/WhiteSpaces.java"; File copy = TestHelper.createCopy(tempRoot, resourcePath, fileName); List transformations = createProcessorSupplier(v -> new TestAnnotation(v), - v -> new AssertionsTransformation(v)); + v -> new AssertionsTransformation(v)); new TransformationHelper.Builder().path(tempRoot.getAbsolutePath()) .className("WhiteSpaces") .processors(transformations)