-
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.
Close camunda-community-hub#203: use spotbugs to identify possible co…
…de problems * added spotbugs gradle plugin * added seperate job in GHA continous-integration that spotbugs analysis is always executed when a PR is created * defined exclude rule that all generated classes beginning with $ are ignored
- Loading branch information
Showing
6 changed files
with
70 additions
and
1 deletion.
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
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,34 @@ | ||
name: Spotbugs Check | ||
|
||
on: | ||
push: | ||
branches: [ '**' ] | ||
|
||
jobs: | ||
spotbugs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Git Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- name: Cache Dependencies #see https://github.com/actions/cache/blob/master/examples.md#java---gradle | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-spotbugs-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-spotbugs-gradle- | ||
- name: Spotbugs Checks | ||
id: spotbugs_checks | ||
# ignoreFailures set to true that the xmlReport can parsed and uploaded by next step otherwise this step will fail and the findings are not visible | ||
# xmlReport set to true that the next step can parse the xml and upload the findings | ||
run: ./gradlew spotbugsMain -Pspotbugs.ignoreFailures=true -Pspotbugs.xmlReport=true | ||
- name: Publish Spotbugs Results | ||
# TODO switch to orignial GHA when PR jwgmeligmeyling/spotbugs-github-action#10 is integrated | ||
uses: arolfes/spotbugs-github-action@master | ||
with: | ||
path: '**/spotbugs/*.xml' | ||
threshold: 0 # apply zero-warning policy |
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
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 @@ | ||
<FindBugsFilter> | ||
<Match> | ||
<!-- Exclude all Micronaut generated Classes from Annotations --> | ||
<Class name="~.*\.\$.*" /> | ||
</Match> | ||
</FindBugsFilter> |
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