Skip to content

Commit ad73bfb

Browse files
* Add Spotbugs
* Add spotbugs tests to test workflow
1 parent 55121c7 commit ad73bfb

File tree

2 files changed

+36
-33
lines changed

2 files changed

+36
-33
lines changed

.github/workflows/test.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -41,39 +41,39 @@ jobs:
4141
# - name: Temporary Artifacts Cleanup
4242
# run: rm -rf ./artifacts
4343
#
44-
# spotbugs:
45-
# name: ${{ inputs.name }} Spotbugs
46-
# runs-on: ubuntu-latest
47-
# steps:
48-
# - name: Checkout Repository
49-
# uses: actions/checkout@v4
50-
#
51-
# - name: Setup Java 21 LTS
52-
# uses: actions/setup-java@v4
53-
# with:
54-
# java-version: 21
55-
# distribution: 'temurin'
56-
#
57-
# - name: Execute Spotbugs
58-
# run: ./gradlew spotbugsMain spotbugsTest spotbugsIntegrationTest
59-
# working-directory: ${{ inputs.path }}
60-
#
61-
# - name: Collect Artifacts
62-
# if: always()
63-
# run: |
64-
# mkdir -p artifacts
65-
# cp -r ./${{ inputs.path }}/build/reports ./artifacts
66-
#
67-
# - name: Upload Artifacts
68-
# uses: actions/upload-artifact@v4
69-
# if: always()
70-
# with:
71-
# name: '${{ inputs.name }} Spotbugs Report'
72-
# path: ./artifacts/**
73-
# compression-level: 9
74-
#
75-
# - name: Temporary Artifacts Cleanup
76-
# run: rm -rf ./artifacts
44+
spotbugs:
45+
name: Spotbugs
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Checkout Repository
49+
uses: actions/checkout@v4
50+
51+
- name: Setup Java 21 LTS
52+
uses: actions/setup-java@v4
53+
with:
54+
java-version: 21
55+
distribution: temurin
56+
57+
- name: Execute Spotbugs
58+
run: ./gradlew spotbugsMain spotbugsTest spotbugsIntTest spotbugsRecepResponder
59+
working-directory: ${{ inputs.path }}
60+
61+
- name: Collect Artifacts
62+
if: always()
63+
run: |
64+
mkdir -p artifacts
65+
cp -r ./${{ inputs.path }}/build/reports ./artifacts
66+
67+
- name: Upload Artifacts
68+
uses: actions/upload-artifact@v4
69+
if: always()
70+
with:
71+
name: Spotbugs Report
72+
path: ./artifacts/**
73+
compression-level: 9
74+
75+
- name: Temporary Artifacts Cleanup
76+
run: rm -rf ./artifacts
7777

7878
unit-tests:
7979
name: Unit Tests

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ plugins {
33
id 'io.spring.dependency-management' version '1.0.9.RELEASE'
44
id 'java'
55
id "io.freefair.lombok" version "5.1.0"
6+
id "com.github.spotbugs" version "6.1.6"
67
id 'jacoco'
78
}
89

10+
apply plugin: "com.github.spotbugs"
11+
912
group = 'uk.nhs.digital.nhsconnect'
1013
version = '0.0.1-SNAPSHOT'
1114
sourceCompatibility = '11'

0 commit comments

Comments
 (0)