Added sonarcloud to GitHub workflow

This commit is contained in:
Erik C. Thauvin 2023-08-12 12:52:56 -07:00
parent 2c6493c631
commit 92ed30a415
5 changed files with 28 additions and 4 deletions

View file

@ -29,4 +29,19 @@ jobs:
run: ./bld download
- 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
View file

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<pattern value="net.thauvin.erik.httpstatus.HttpStatusBuild" />

Binary file not shown.

View file

@ -1,6 +1,7 @@
bld.downloadExtensionJavadoc=false
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.downloadLocation=
bld.version=1.7.0

View file

@ -35,12 +35,14 @@ package net.thauvin.erik.httpstatus;
import rife.bld.BuildCommand;
import rife.bld.Project;
import rife.bld.dependencies.Dependency;
import rife.bld.extension.JacocoReportOperation;
import rife.bld.extension.PmdOperation;
import rife.bld.publish.PublishDeveloper;
import rife.bld.publish.PublishInfo;
import rife.bld.publish.PublishLicense;
import rife.bld.publish.PublishScm;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
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);
}
@BuildCommand(summary = "Generates Jacoco Reports")
public void jacoco() throws IOException {
new JacocoReportOperation()
.fromProject(this)
.execute();
}
@BuildCommand(summary = "Runs PMD analysis")
public void pmd() throws Exception {
public void pmd() {
new PmdOperation()
.fromProject(this)
.failOnViolation(true)