Moved Sonarqube to GitHub action.
This commit is contained in:
parent
79945ad2df
commit
ba0b56f9e2
6 changed files with 49 additions and 14 deletions
42
.github/workflows/gradle.yml
vendored
Normal file
42
.github/workflows/gradle.yml
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
name: Java CI with Gradle
|
||||
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 11
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Cache SonarCloud packages
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.sonar/cache
|
||||
key: ${{ runner.os }}-sonar
|
||||
restore-keys: ${{ runner.os }}-sonar
|
||||
- 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: Test with Gradle
|
||||
env:
|
||||
CI_NAME: "GitHub CI"
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
run: ./gradlew check sonarqube
|
||||
- name: Cleanup Gradle Cache
|
||||
run: |
|
||||
rm -f ~/.gradle/caches/modules-2/modules-2.lock
|
||||
rm -f ~/.gradle/caches/modules-2/gc.properties
|
10
.travis.yml
10
.travis.yml
|
@ -4,15 +4,5 @@ dist: trusty
|
|||
jdk:
|
||||
- oraclejdk8
|
||||
|
||||
addons:
|
||||
sonarcloud:
|
||||
organization: "ethauvin-github"
|
||||
|
||||
before_install:
|
||||
- chmod +x gradlew
|
||||
|
||||
after_success:
|
||||
- |
|
||||
if [ "${TRAVIS_TEST_RESULT}" == 0 ]; then
|
||||
./gradlew sonarqube
|
||||
fi
|
||||
|
|
|
@ -134,6 +134,7 @@ javadoc {
|
|||
test {
|
||||
testLogging {
|
||||
exceptionFormat "full"
|
||||
events "passed", "skipped", "failed"
|
||||
}
|
||||
|
||||
useTestNG()
|
||||
|
@ -197,7 +198,9 @@ jacocoTestReport {
|
|||
|
||||
sonarqube {
|
||||
properties {
|
||||
property("sonar.projectKey", "ethauvin_semver")
|
||||
property "sonar.organization", "ethauvin-github"
|
||||
property "sonar.projectKey", "ethauvin_semver"
|
||||
property "sonar.host.url", "https://sonarcloud.io"
|
||||
property("sonar.sourceEncoding", "UTF-8")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,5 +1,5 @@
|
|||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue