Optimize CI #82
12
.github/workflows/tests.yml
vendored
12
.github/workflows/tests.yml
vendored
@@ -4,12 +4,9 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
- 'master'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -97,6 +94,13 @@ jobs:
|
||||
with:
|
||||
gradle-version: 6.8
|
||||
arguments: test -x testSql
|
||||
- name: Coverage
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
gradle-version: 6.8
|
||||
arguments: coveralls
|
||||
env:
|
||||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
|
||||
|
||||
lint:
|
||||
needs: build
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
[](https://www.codefactor.io/repository/github/flecomte/dc-project)
|
||||
[](https://github.com/flecomte/dc-project/actions/workflows/tests.yml)
|
||||
[](https://coveralls.io/github/flecomte/dc-project?branch=master)
|
||||
[](https://www.codacy.com/gh/flecomte/dc-project/dashboard?utm_source=github.com&utm_medium=referral&utm_content=flecomte/dc-project&utm_campaign=Badge_Grade)
|
||||
|
||||
|
||||
[Installation](./doc/installation/Installation.md)
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ plugins {
|
||||
id("net.nemerosa.versioning") version "2.14.0"
|
||||
id("io.gitlab.arturbosch.detekt") version "1.16.0-RC1"
|
||||
id("com.avast.gradle.docker-compose") version "0.14.0"
|
||||
id("com.github.kt3k.coveralls") version "2.8.4"
|
||||
}
|
||||
|
||||
application {
|
||||
@@ -60,6 +61,9 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.distZip.configure { enabled = false }
|
||||
tasks.distTar.configure { enabled = false }
|
||||
|
||||
tasks.withType<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
jvmTarget = "11"
|
||||
@@ -191,10 +195,20 @@ tasks.test {
|
||||
useJUnitPlatform()
|
||||
systemProperty("junit.jupiter.execution.parallel.enabled", true)
|
||||
dependsOn(testSql)
|
||||
finalizedBy(tasks.ktlintCheck)
|
||||
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
|
||||
}
|
||||
|
||||
coveralls {
|
||||
sourceDirs.add("src/main/kotlin")
|
||||
}
|
||||
|
||||
tasks.register("testAll") {
|
||||
group = "verification"
|
||||
dependsOn(testSql)
|
||||
dependsOn(tasks.test)
|
||||
dependsOn(tasks.ktlintCheck)
|
||||
}
|
||||
|
||||
apply(plugin = "docker-compose")
|
||||
dockerCompose {
|
||||
projectName = "dc-project"
|
||||
|
||||
@@ -59,33 +59,33 @@ class ArticleViewManager <A> (private val restClient: RestClient) : ViewManager<
|
||||
//language=JSON
|
||||
setJsonEntity(
|
||||
"""
|
||||
{
|
||||
"size": 0,
|
||||
"query": {
|
||||
"bool": {
|
||||
"must": {
|
||||
"term": {
|
||||
"version_id": "${entity.versionId}"
|
||||
{
|
||||
"size": 0,
|
||||
"query": {
|
||||
"bool": {
|
||||
"must": {
|
||||
"term": {
|
||||
"version_id": "${entity.versionId}"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"aggs" : {
|
||||
"total": {
|
||||
"composite" : {
|
||||
"sources" : [
|
||||
{ "version_id": { "terms": {"field": "version_id" } } }
|
||||
]
|
||||
}
|
||||
},
|
||||
"unique" : {
|
||||
"cardinality" : {
|
||||
"field" : "user_ref",
|
||||
"precision_threshold": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"aggs" : {
|
||||
"total": {
|
||||
"composite" : {
|
||||
"sources" : [
|
||||
{ "version_id": { "terms": {"field": "version_id" } } }
|
||||
]
|
||||
}
|
||||
},
|
||||
"unique" : {
|
||||
"cardinality" : {
|
||||
"field" : "user_ref",
|
||||
"precision_threshold": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user