Create CI #78
99
.github/workflows/tests.yml
vendored
99
.github/workflows/tests.yml
vendored
@@ -12,8 +12,7 @@ on:
|
|||||||
- '**'
|
- '**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -22,7 +21,99 @@ jobs:
|
|||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: 11
|
||||||
- uses: eskatos/gradle-command-action@v1
|
|
||||||
|
- name: Cache Gradle packages
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.gradle/caches
|
||||||
|
~/.gradle/wrapper
|
||||||
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-gradle-
|
||||||
|
- name: Build
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
with:
|
with:
|
||||||
gradle-version: 6.8
|
gradle-version: 6.8
|
||||||
arguments: test
|
arguments: build -x test -x ktlintKotlinScriptCheck -x ktlintTestSourceSetCheck -x ktlintMainSourceSetCheck -x detekt
|
||||||
|
- name: Cleanup Gradle Cache
|
||||||
|
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions.
|
||||||
|
# Restoring these files from a GitHub Actions cache might cause problems for future builds.
|
||||||
|
run: |
|
||||||
|
rm -f ~/.gradle/caches/modules-2/modules-2.lock
|
||||||
|
rm -f ~/.gradle/caches/modules-2/gc.properties
|
||||||
|
|
||||||
|
- name: processResources
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
with:
|
||||||
|
gradle-version: 6.8
|
||||||
|
arguments: processResources
|
||||||
|
- name: processTestResources
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
with:
|
||||||
|
gradle-version: 6.8
|
||||||
|
arguments: processResources
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: Build
|
||||||
|
path: build
|
||||||
|
|
||||||
|
testSql:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: Build
|
||||||
|
path: build
|
||||||
|
- name: TestSql
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
with:
|
||||||
|
gradle-version: 6.8
|
||||||
|
arguments: testSql
|
||||||
|
|
||||||
|
test:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: Build
|
||||||
|
path: build
|
||||||
|
- name: Test
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
with:
|
||||||
|
gradle-version: 6.8
|
||||||
|
arguments: test -x testSql
|
||||||
|
|
||||||
|
lint:
|
||||||
|
needs: build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Set up JDK 11
|
||||||
|
uses: actions/setup-java@v1
|
||||||
|
with:
|
||||||
|
java-version: 11
|
||||||
|
- uses: actions/download-artifact@v2
|
||||||
|
with:
|
||||||
|
name: Build
|
||||||
|
path: build
|
||||||
|
- name: Lint
|
||||||
|
uses: eskatos/gradle-command-action@v1
|
||||||
|
with:
|
||||||
|
gradle-version: 6.8
|
||||||
|
arguments: ktlintCheck
|
||||||
|
|||||||
@@ -267,6 +267,7 @@ tasks.jacocoTestReport {
|
|||||||
|
|
||||||
detekt {
|
detekt {
|
||||||
buildUponDefaultConfig = true // preconfigure defaults
|
buildUponDefaultConfig = true // preconfigure defaults
|
||||||
|
ignoreFailures = true
|
||||||
// config = files("$projectDir/config/detekt.yml") // point to your custom config defining rules to run, overwriting default behavior
|
// config = files("$projectDir/config/detekt.yml") // point to your custom config defining rules to run, overwriting default behavior
|
||||||
// baseline = file("$projectDir/config/baseline.xml") // a way of suppressing issues before introducing detekt
|
// baseline = file("$projectDir/config/baseline.xml") // a way of suppressing issues before introducing detekt
|
||||||
|
|
||||||
@@ -281,6 +282,7 @@ detekt {
|
|||||||
tasks.withType<Detekt> {
|
tasks.withType<Detekt> {
|
||||||
// Target version of the generated JVM bytecode. It is used for type resolution.
|
// Target version of the generated JVM bytecode. It is used for type resolution.
|
||||||
this.jvmTarget = "11"
|
this.jvmTarget = "11"
|
||||||
|
ignoreFailures = true
|
||||||
}
|
}
|
||||||
|
|
||||||
val setMaxMapCount = tasks.create<Exec>("setMaxMapCount") {
|
val setMaxMapCount = tasks.create<Exec>("setMaxMapCount") {
|
||||||
|
|||||||
Reference in New Issue
Block a user