Added Github workflow martix for JDK 1.8, 11 & 15.
This commit is contained in:
parent
5e6a29fbe0
commit
f7ef436a72
1 changed files with 15 additions and 6 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: [ 1.8, 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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue