Added GitHub matrix for Java 11 & 15.
This commit is contained in:
parent
b547a4d07d
commit
8f08fd738b
3 changed files with 26 additions and 17 deletions
21
.github/workflows/gradle.yml
vendored
21
.github/workflows/gradle.yml
vendored
|
@ -5,17 +5,24 @@ on: [push, pull_request, workflow_dispatch]
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m"
|
||||||
|
SONAR_JDK: "11"
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
java-version: [ 11, 15 ]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: Set up JDK 11
|
- name: Set up JDK ${{ matrix.java-version }}
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
java-version: ${{ matrix.java-version }}
|
||||||
- name: Grant execute permission for gradlew
|
- name: Grant execute permission for gradlew
|
||||||
run: chmod +x gradlew
|
run: chmod +x gradlew
|
||||||
- name: Cache SonarCloud packages
|
- name: Cache SonarCloud packages
|
||||||
|
if: matrix.java-version == env.SONAR_JDK
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1
|
||||||
with:
|
with:
|
||||||
path: ~/.sonar/cache
|
path: ~/.sonar/cache
|
||||||
|
@ -27,15 +34,17 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
~/.gradle/caches
|
~/.gradle/caches
|
||||||
~/.gradle/wrapper
|
~/.gradle/wrapper
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
key: ${{ runner.os }}-gradle-${{ matrix.java-version }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradle-
|
${{ runner.os }}-gradle-${{ matrix.java-version }}-
|
||||||
- name: Test with Gradle
|
- name: Test with Gradle
|
||||||
|
run: ./gradlew build check --stacktrace
|
||||||
|
- name: SonarCloud
|
||||||
|
if: success() && matrix.java-version == env.SONAR_JDK
|
||||||
env:
|
env:
|
||||||
CI_NAME: "GitHub CI"
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
run: ./gradlew check sonarqube
|
run: ./gradlew sonarqube
|
||||||
- name: Cleanup Gradle Cache
|
- name: Cleanup Gradle Cache
|
||||||
run: |
|
run: |
|
||||||
rm -f ~/.gradle/caches/modules-2/modules-2.lock
|
rm -f ~/.gradle/caches/modules-2/modules-2.lock
|
||||||
|
|
|
@ -4,16 +4,16 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
id("application")
|
||||||
id("com.github.ben-manes.versions") version "0.39.0"
|
id("com.github.ben-manes.versions") version "0.39.0"
|
||||||
id("io.gitlab.arturbosch.detekt") version "1.17.1"
|
id("io.gitlab.arturbosch.detekt") version "1.17.1"
|
||||||
|
id("jacoco")
|
||||||
|
id("java")
|
||||||
|
id("maven-publish")
|
||||||
id("org.jetbrains.dokka") version "1.4.32"
|
id("org.jetbrains.dokka") version "1.4.32"
|
||||||
id("org.sonarqube") version "3.2.0"
|
id("org.sonarqube") version "3.2.0"
|
||||||
|
id("signing")
|
||||||
kotlin("jvm") version "1.5.10"
|
kotlin("jvm") version "1.5.10"
|
||||||
application
|
|
||||||
`maven-publish`
|
|
||||||
jacoco
|
|
||||||
java
|
|
||||||
signing
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
|
defaultTasks(ApplicationPlugin.TASK_RUN_NAME)
|
||||||
|
@ -33,14 +33,14 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
|
implementation(platform(kotlin("bom")))
|
||||||
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
|
implementation(kotlin("stdlib-jdk8"))
|
||||||
|
|
||||||
implementation("com.squareup.okhttp3:okhttp:4.9.1")
|
implementation("com.squareup.okhttp3:okhttp:4.9.1")
|
||||||
implementation("org.json:json:20210307")
|
implementation("org.json:json:20210307")
|
||||||
|
|
||||||
testImplementation("org.jetbrains.kotlin:kotlin-test")
|
testImplementation(kotlin("test"))
|
||||||
testImplementation("org.jetbrains.kotlin:kotlin-test-junit")
|
testImplementation(kotlin("test-junit"))
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
plugins {
|
plugins {
|
||||||
id("org.jetbrains.kotlin.jvm") version "1.5.10"
|
id("application")
|
||||||
id("com.github.ben-manes.versions") version "0.39.0"
|
id("com.github.ben-manes.versions") version "0.39.0"
|
||||||
application
|
kotlin("jvm") version "1.5.10"
|
||||||
}
|
}
|
||||||
|
|
||||||
// ./gradlew run
|
// ./gradlew run
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue