From e19266d4cc70452f47747ab1aa36d2389c799306 Mon Sep 17 00:00:00 2001 From: Fabrice Lecomte Date: Sat, 20 Mar 2021 03:20:07 +0100 Subject: [PATCH] Create CI Action --- .github/workflows/tests.yml | 28 ++++++++++++++++++++++++++++ README.md | 2 ++ build.gradle.kts | 15 +++++++++------ 3 files changed, 39 insertions(+), 6 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 0000000..2639947 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,28 @@ +# This workflow will build a Java project with Gradle +# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle + +name: Tests + +on: + push: + branches: + - '**' + pull_request: + branches: + - '**' + +jobs: + tests: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - uses: eskatos/gradle-command-action@v1 + with: + gradle-version: 6.8 + arguments: test diff --git a/README.md b/README.md index b8aeb3f..8684665 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # DC Project +[![Tests](https://github.com/flecomte/dc-project/actions/workflows/tests.yml/badge.svg)](https://github.com/flecomte/dc-project/actions/workflows/tests.yml) + [Installation](./doc/installation) ### Run dockers diff --git a/build.gradle.kts b/build.gradle.kts index 2802b2d..4f00fe4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -56,7 +56,7 @@ buildscript { } dependencies { classpath("com.typesafe:config:1.4.1") - classpath("com.github.flecomte:postgres-json:2.1.1") + classpath("com.github.flecomte:postgres-json:2.1.2") } } @@ -136,9 +136,7 @@ val testSql by tasks.registering { file("$buildDir/resources/main/sql/migrations").toURI(), file("$buildDir/resources/main/sql/functions").toURI(), file("$buildDir/resources/test/sql/fixtures").toURI() - ).run { - run() - } + ).run() Requester.RequesterFactory( connection = connection, @@ -295,7 +293,12 @@ val setMaxMapCount = tasks.create("setMaxMapCount") { } } } -tasks.named("testComposeUp").configure { dependsOn(setMaxMapCount) } + +tasks.named("testComposeUp").configure { + if (OperatingSystem.current().isWindows) { + dependsOn(setMaxMapCount) + } +} dependencyCheck { formats = listOf(ReportGenerator.Format.HTML, ReportGenerator.Format.XML) @@ -329,7 +332,7 @@ dependencies { implementation("net.pearx.kasechange:kasechange-jvm:1.3.0") implementation("com.auth0:java-jwt:3.12.0") implementation("com.github.jasync-sql:jasync-postgresql:1.1.6") - implementation("com.github.flecomte:postgres-json:2.1.1") + implementation("com.github.flecomte:postgres-json:2.1.2") implementation("com.sendgrid:sendgrid-java:4.7.1") implementation("io.lettuce:lettuce-core:5.3.6.RELEASE") // TODO update to 6.0.2 implementation("com.rabbitmq:amqp-client:5.10.0")