Added sonarcloud to GitHub workflow
This commit is contained in:
parent
2c6493c631
commit
92ed30a415
5 changed files with 28 additions and 4 deletions
17
.github/workflows/bld.yml
vendored
17
.github/workflows/bld.yml
vendored
|
@ -29,4 +29,19 @@ jobs:
|
||||||
run: ./bld download
|
run: ./bld download
|
||||||
|
|
||||||
- name: Run tests with bld
|
- name: Run tests with bld
|
||||||
run: ./bld compile test
|
run: ./bld compile jacoco
|
||||||
|
|
||||||
|
- name: SonarCloud Scan
|
||||||
|
uses: sonarsource/sonarcloud-github-action@master
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
args: >
|
||||||
|
-Dsonar.organization=ethauvin-github
|
||||||
|
-Dsonar.projectKey=my-ethauvin_HttpStatus
|
||||||
|
-Dsonar.coverage.jacoco.xmlReportPaths=build/reports/jacoco/test/jacocoTestReport.xml
|
||||||
|
-Dsonar.jacoco.reportPath=build/jacoco/jacoco.exec
|
||||||
|
-Dsonar.sources=src/main/java/
|
||||||
|
-Dsonar.tests=src/test/java/
|
||||||
|
-Dsonar.verbose=true
|
||||||
|
|
||||||
|
|
1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
|
@ -1,4 +1,3 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="EntryPointsManager">
|
<component name="EntryPointsManager">
|
||||||
<pattern value="net.thauvin.erik.httpstatus.HttpStatusBuild" />
|
<pattern value="net.thauvin.erik.httpstatus.HttpStatusBuild" />
|
||||||
|
|
Binary file not shown.
|
@ -1,6 +1,7 @@
|
||||||
bld.downloadExtensionJavadoc=false
|
bld.downloadExtensionJavadoc=false
|
||||||
bld.downloadExtensionSources=true
|
bld.downloadExtensionSources=true
|
||||||
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.1
|
bld.extension-pmd=com.uwyn.rife2:bld-pmd:0.9.2-SNAPSHOT
|
||||||
|
bld.extension-jacoco=com.uwyn.rife2:bld-jacoco-report:0.9.0-SNAPSHOT
|
||||||
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
|
bld.repositories=MAVEN_LOCAL,MAVEN_CENTRAL,RIFE2_SNAPSHOTS,RIFE2_RELEASES
|
||||||
bld.downloadLocation=
|
bld.downloadLocation=
|
||||||
bld.version=1.7.0
|
bld.version=1.7.0
|
||||||
|
|
|
@ -35,12 +35,14 @@ package net.thauvin.erik.httpstatus;
|
||||||
import rife.bld.BuildCommand;
|
import rife.bld.BuildCommand;
|
||||||
import rife.bld.Project;
|
import rife.bld.Project;
|
||||||
import rife.bld.dependencies.Dependency;
|
import rife.bld.dependencies.Dependency;
|
||||||
|
import rife.bld.extension.JacocoReportOperation;
|
||||||
import rife.bld.extension.PmdOperation;
|
import rife.bld.extension.PmdOperation;
|
||||||
import rife.bld.publish.PublishDeveloper;
|
import rife.bld.publish.PublishDeveloper;
|
||||||
import rife.bld.publish.PublishInfo;
|
import rife.bld.publish.PublishInfo;
|
||||||
import rife.bld.publish.PublishLicense;
|
import rife.bld.publish.PublishLicense;
|
||||||
import rife.bld.publish.PublishScm;
|
import rife.bld.publish.PublishScm;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.StandardCopyOption;
|
import java.nio.file.StandardCopyOption;
|
||||||
|
@ -117,8 +119,15 @@ public class HttpStatusBuild extends Project {
|
||||||
Files.copy(pomPath, Path.of(workDirectory.getAbsolutePath(), "pom.xml"), StandardCopyOption.REPLACE_EXISTING);
|
Files.copy(pomPath, Path.of(workDirectory.getAbsolutePath(), "pom.xml"), StandardCopyOption.REPLACE_EXISTING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@BuildCommand(summary = "Generates Jacoco Reports")
|
||||||
|
public void jacoco() throws IOException {
|
||||||
|
new JacocoReportOperation()
|
||||||
|
.fromProject(this)
|
||||||
|
.execute();
|
||||||
|
}
|
||||||
|
|
||||||
@BuildCommand(summary = "Runs PMD analysis")
|
@BuildCommand(summary = "Runs PMD analysis")
|
||||||
public void pmd() throws Exception {
|
public void pmd() {
|
||||||
new PmdOperation()
|
new PmdOperation()
|
||||||
.fromProject(this)
|
.fromProject(this)
|
||||||
.failOnViolation(true)
|
.failOnViolation(true)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue