Skip to content

Commit

Permalink
Activate SonarQube
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelbl committed May 27, 2024
1 parent 8a81019 commit 68d690c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 12 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,34 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v3
- name: Build with Gradle
working-directory: ./generator
run: ./gradlew build
- name: Upload received files from failing tests
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
name: Received-${{ runner.os }}
path: "generator/actual_*"
- name: Upload test results
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
name: TestResults-${{ runner.os }}
path: generator/build/reports/tests/test
- name: SonarQube
env:
SONAR_LOGIN: ${{ secrets.SONAR_LOGIN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: ./generator
if: ${{ github.ref == 'refs/heads/v3' }}
run: ./gradlew sonarqube -Dsonar.login=$SONAR_LOGIN
run: ./gradlew jacocoTestReport sonar -Dsonar.token=$SONAR_TOKEN
8 changes: 7 additions & 1 deletion generator/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jar {
'Implementation-Version': archiveVersion,
'Implementation-Vendor': 'Manuel Bleichenbacher'
)

}
}

Expand All @@ -47,6 +46,10 @@ javadoc {
options.addBooleanOption('html5', true)
}

test {
useJUnitPlatform()
}

artifacts {
archives javadocJar, sourcesJar
}
Expand Down Expand Up @@ -112,8 +115,11 @@ sonar {
}

jacocoTestReport {
dependsOn test
reports {
xml.required = true
html.required = false
csv.required = false
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,19 @@ void addPageToOpenPdfDocument() throws IOException {
compareResult(path, "pdfcanvas-opendoc.pdf");
}

@Test
void coloredLines() throws IOException {
Path path = Files.createTempFile("pdfcanvas-", ".pdf");
try (PDFCanvas canvas = new PDFCanvas(100, 100)) {
canvas.moveTo(10, 10);
canvas.lineTo(90, 90);
canvas.strokePath(2, 0xFF00FF, Canvas.LineStyle.Dashed, true);
canvas.saveAs(path);
}

compareResult(path, "pdfcanvas-colored-line.pdf");
}

@Test
void addPageToOpenContentStream() throws IOException {
PDDocument document = new PDDocument();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertTrue;

/**
* Unit tests for generation of A6 bills (PDF and SVG)
* <p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.codecrete.qrbill.generator;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;

Expand Down
Binary file not shown.

0 comments on commit 68d690c

Please sign in to comment.