-
Notifications
You must be signed in to change notification settings - Fork 14
64 lines (60 loc) · 2.04 KB
/
spotbugs-analysis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Code Analysis (SpotBugs)
on:
pull_request:
push:
workflow_dispatch:
jobs:
dupe_check:
name: Check for Duplicate Workflow Run
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
concurrent_skipping: same_content
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
run-analysis:
name: Run SpotBugs Static Code Analysis
needs:
- dupe_check
if: needs.dupe_check.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
submodules: recursive
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-spotbugs-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-spotbugs-
- name: Setup JDK 8
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 8
- name: Install Test Support
run: mvn clean install -f solace-integration-test-support/ -DskipTests
- name: Run static code analysis
run: mvn clean compile spotbugs:check
- name: Upload Test Artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: Static Code Analysis Results
path: |
beam-sdks-java-io-solace/target/spotbugs.xml
beam-sdks-java-io-solace/target/spotbugsXml.xml
# Migrate this to upload-sarif action once https://github.com/spotbugs/spotbugs-maven-plugin/pull/339 is released
- name: Publish SpotBugs report
if: success() || failure()
uses: jwgmeligmeyling/[email protected]
with:
name: SpotBugs
path: beam-sdks-java-io-solace/target/spotbugsXml.xml
title: SpotBugs Source Code Analyzer report