Merge pull request #82 from flecomte/lint

Optimize CI
This commit was merged in pull request #82.
This commit is contained in:
2021-03-25 02:07:52 +01:00
committed by GitHub
4 changed files with 50 additions and 29 deletions

View File

@@ -4,12 +4,9 @@
name: Tests name: Tests
on: on:
push:
branches:
- '**'
pull_request: pull_request:
branches: branches:
- '**' - 'master'
jobs: jobs:
build: build:
@@ -97,6 +94,13 @@ jobs:
with: with:
gradle-version: 6.8 gradle-version: 6.8
arguments: test -x testSql 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: lint:
needs: build needs: build

View File

@@ -2,6 +2,9 @@
[![CodeFactor](https://www.codefactor.io/repository/github/flecomte/dc-project/badge?s=869dc426625a253a07bea95f9380e23fdb048b94)](https://www.codefactor.io/repository/github/flecomte/dc-project) [![CodeFactor](https://www.codefactor.io/repository/github/flecomte/dc-project/badge?s=869dc426625a253a07bea95f9380e23fdb048b94)](https://www.codefactor.io/repository/github/flecomte/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) [![Tests](https://github.com/flecomte/dc-project/actions/workflows/tests.yml/badge.svg)](https://github.com/flecomte/dc-project/actions/workflows/tests.yml)
[![Coverage Status](https://coveralls.io/repos/github/flecomte/dc-project/badge.svg?branch=master)](https://coveralls.io/github/flecomte/dc-project?branch=master)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/0ec4fe63370148ca956974f90f8d55be)](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) [Installation](./doc/installation/Installation.md)

View File

@@ -41,6 +41,7 @@ plugins {
id("net.nemerosa.versioning") version "2.14.0" id("net.nemerosa.versioning") version "2.14.0"
id("io.gitlab.arturbosch.detekt") version "1.16.0-RC1" id("io.gitlab.arturbosch.detekt") version "1.16.0-RC1"
id("com.avast.gradle.docker-compose") version "0.14.0" id("com.avast.gradle.docker-compose") version "0.14.0"
id("com.github.kt3k.coveralls") version "2.8.4"
} }
application { application {
@@ -60,6 +61,9 @@ buildscript {
} }
} }
tasks.distZip.configure { enabled = false }
tasks.distTar.configure { enabled = false }
tasks.withType<KotlinCompile> { tasks.withType<KotlinCompile> {
kotlinOptions { kotlinOptions {
jvmTarget = "11" jvmTarget = "11"
@@ -191,10 +195,20 @@ tasks.test {
useJUnitPlatform() useJUnitPlatform()
systemProperty("junit.jupiter.execution.parallel.enabled", true) systemProperty("junit.jupiter.execution.parallel.enabled", true)
dependsOn(testSql) dependsOn(testSql)
finalizedBy(tasks.ktlintCheck)
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run 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") apply(plugin = "docker-compose")
dockerCompose { dockerCompose {
projectName = "dc-project" projectName = "dc-project"