Added Github workflow martix for JDK 1.8, 11 & 15.
This commit is contained in:
parent
ba4a374853
commit
7335f7d6b1
3 changed files with 30 additions and 22 deletions
24
.github/workflows/gradle.yml
vendored
24
.github/workflows/gradle.yml
vendored
|
@ -5,17 +5,24 @@ on: [push, pull_request, workflow_dispatch]
|
|||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-XX:MaxMetaspaceSize=512m"
|
||||
SONAR_JDK: "11"
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: [ 1.8, 11, 15 ]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up JDK 11
|
||||
- name: Set up JDK ${{ matrix.java-version }}
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
java-version: ${{ matrix.java-version }}
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Cache SonarCloud packages
|
||||
if: matrix.java-version == env.SONAR_JDK
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.sonar/cache
|
||||
|
@ -27,16 +34,19 @@ jobs:
|
|||
path: |
|
||||
~/.gradle/caches
|
||||
~/.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: |
|
||||
${{ runner.os }}-gradle-
|
||||
${{ runner.os }}-gradle-${{ matrix.java-version }}-
|
||||
- name: Test with Gradle
|
||||
env:
|
||||
CI_NAME: "GitHub CI"
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PINBOARD_API_TOKEN: ${{ secrets.PINBOARD_API_TOKEN }}
|
||||
run: ./gradlew build check --stacktrace
|
||||
- name: SonarCloud
|
||||
if: success() && matrix.java-version == env.SONAR_JDK
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
run: ./gradlew check sonarqube
|
||||
run: ./gradlew sonarqube
|
||||
- name: Cleanup Gradle Cache
|
||||
run: |
|
||||
rm -f ~/.gradle/caches/modules-2/modules-2.lock
|
||||
|
|
|
@ -3,15 +3,15 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
|||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||
|
||||
plugins {
|
||||
jacoco
|
||||
java
|
||||
kotlin("jvm") version "1.5.0"
|
||||
`maven-publish`
|
||||
signing
|
||||
id("com.github.ben-manes.versions") version "0.38.0"
|
||||
id("com.github.ben-manes.versions") version "0.39.0"
|
||||
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.sonarqube") version "3.2.0"
|
||||
id("signing")
|
||||
kotlin("jvm") version "1.5.10"
|
||||
}
|
||||
|
||||
group = "net.thauvin.erik"
|
||||
|
@ -25,22 +25,20 @@ var isRelease = "release" in gradle.startParameter.taskNames
|
|||
|
||||
val publicationName = "mavenJava"
|
||||
|
||||
object VersionInfo {
|
||||
const val okhttp = "4.9.1"
|
||||
object Versions {
|
||||
const val OKHTTP = "4.9.1"
|
||||
}
|
||||
|
||||
val versions: VersionInfo by extra { VersionInfo }
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
|
||||
implementation(platform(kotlin("bom")))
|
||||
|
||||
implementation("com.squareup.okhttp3:okhttp:${versions.okhttp}")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:${versions.okhttp}")
|
||||
implementation("com.squareup.okhttp3:okhttp:${Versions.OKHTTP}")
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:${Versions.OKHTTP}")
|
||||
|
||||
testImplementation("org.testng:testng:7.4.0")
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
plugins {
|
||||
application
|
||||
kotlin("jvm") version "1.5.0"
|
||||
id("application")
|
||||
kotlin("jvm") version "1.5.10"
|
||||
}
|
||||
|
||||
// ./gradlew run
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue