-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github actions and sonarqube integration
- Loading branch information
Showing
21 changed files
with
584 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
name: Build | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
branches: | ||
- "master" | ||
- "main" | ||
- "develop" | ||
paths-ignore: | ||
- '.gitignore' | ||
- 'CODEOWNERS' | ||
- 'LICENSE' | ||
- '*.md' | ||
- '*.adoc' | ||
- '*.txt' | ||
- '.all-contributorsrc' | ||
pull_request: | ||
paths-ignore: | ||
- '.gitignore' | ||
- 'CODEOWNERS' | ||
- 'LICENSE' | ||
- '*.md' | ||
- '*.adoc' | ||
- '*.txt' | ||
- '.all-contributorsrc' | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
checks: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
cache: 'gradle' | ||
- name: Cache SonarQube packages | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.sonar/cache | ||
key: ${{ runner.os }}-sonar | ||
restore-keys: ${{ runner.os }}-sonar | ||
- name: Build and analyze | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
run: ./gradlew build sonar --no-daemon | ||
- name: Build native | ||
run: ./gradlew build --no-daemon -Dquarkus.package.type=native |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
name: release-build | ||
|
||
on: # yamllint disable-line rule:truthy | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Install graalvm | ||
uses: DeLaGuardo/setup-graalvm@3 | ||
with: | ||
graalvm-version: '20.0.0.java11' | ||
- name: Install native-image | ||
run: gu install native-image | ||
- name: Build native executable | ||
run: "./gradlew -Pversion=\"${{ github.event.release.tag_name }}\" build -Dquarkus.package.type=native" | ||
- name: Upload native executable | ||
id: upload-native-executable | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./build/qualityannotate-${{ github.event.release.tag_name }}-runner | ||
asset_name: qualityannotate-${{ github.event.release.tag_name }}-linux | ||
asset_content_type: application/octet-stream | ||
- name: Upload config | ||
id: upload-config | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./build/resources/main/application.yml | ||
asset_name: application.yml | ||
asset_content_type: text/yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
line-length: | ||
max: 120 | ||
level: warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
sonar.host.url=https://sonarcloud.io | ||
sonar.projectName=Quality Annotate | ||
sonar.projectKey=qualityannotate | ||
sonar.sourceEncoding=UTF-8 | ||
|
||
|
||
sonar.sources=src/main/java/ | ||
sonar.java.libraries=target/*.jar | ||
sonar.java.binaries=target/classes/org/acme/rest/json | ||
sonar.java.test.binaries=target/test-classes/org/acme/rest/json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package org.qualityannotate.api.qualitytool; | ||
|
||
public record Issue(String fileName, String lineNumber, String comment, String severity) { | ||
public record Issue(String fileName, Integer lineNumber, String comment, String severity) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/main/java/org/qualityannotate/quality/sonarqube/client/Component.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/main/java/org/qualityannotate/quality/sonarqube/client/ComponentMeasures.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/java/org/qualityannotate/quality/sonarqube/client/Facet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.qualityannotate.quality.sonarqube.client; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
import java.util.List; | ||
|
||
public record Facet(List<FacetValue> values) { | ||
|
||
/** | ||
* @param val human readable name of the Facet | ||
* @param count some metric count | ||
*/ | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record FacetValue(String val, String count) { | ||
|
||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/org/qualityannotate/quality/sonarqube/client/IssueSearch.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.qualityannotate.quality.sonarqube.client; | ||
|
||
import java.util.List; | ||
|
||
public record IssueSearch(Paging paging, List<SqIssue> issues, List<Component> components, List<Facet> facets) { | ||
} |
2 changes: 0 additions & 2 deletions
2
src/main/java/org/qualityannotate/quality/sonarqube/client/Measure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/main/java/org/qualityannotate/quality/sonarqube/client/Paging.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package org.qualityannotate.quality.sonarqube.client; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public record Paging(int pageIndex, int pageSize, int total) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.