From f01521038252c139f68e486de81b60a9adb8517b Mon Sep 17 00:00:00 2001 From: Myron Rotter Date: Sat, 4 Jan 2020 11:04:48 +0100 Subject: [PATCH] Add simple gradle workflow --- .github/workflows/gradle.yml | 38 ++++++++++++++++++++++++++++++++++++ .gitignore | 8 ++++++++ build.gradle | 12 ++++++++++-- 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 00000000..3f635f41 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,38 @@ +name: Java gradle CI + +on: + push: + branches: + - Development + +jobs: + test: + name: Test algorithms + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + java-version: [1.8, 11] + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout project + uses: actions/checkout@v2 + with: + ref: Development + - name: Set up jdk + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + - name: JUnit5 tests on ubuntu + if: startsWith(matrix.os, 'ubuntu') + run: | + chmod +x gradlew + ./gradlew clean test + - name: JUnit5 tests on macos + if: startsWith(matrix.os, 'macos') + run: | + chmod +x gradlew + ./gradlew clean test + - name: JUnit5 tests on windows + if: startsWith(matrix.os, 'windows') + run: gradle clean test diff --git a/.gitignore b/.gitignore index 7a55c439..a143f234 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,15 @@ +.settings + +.classpath +.project + Java.iml .idea/* out/ *.iml + .gradle + +bin target build diff --git a/build.gradle b/build.gradle index eeebf86c..04d375e3 100644 --- a/build.gradle +++ b/build.gradle @@ -10,10 +10,18 @@ repositories { } dependencies { - testCompile 'org.junit.jupiter:junit-jupiter-api:5.5.0' + testImplementation('org.junit.jupiter:junit-jupiter-api:5.5.0') + testRuntime('org.junit.jupiter:junit-jupiter-engine:5.5.0') +} + +test { + useJUnitPlatform() + testLogging { + events "passed", "skipped", "failed", "standardOut", "standardError" + } } group = 'algorithm' version = '1.0-SNAPSHOT' description = 'java-algorithm' -sourceCompatibility = '1.8' \ No newline at end of file +sourceCompatibility = '1.8'