Skip to content

Commit

Permalink
Capture reports from build as artefacts (#563)
Browse files Browse the repository at this point in the history
* Capture reports from build as artefacts
  • Loading branch information
big-andy-coates authored Jun 23, 2024
1 parent 670bdc3 commit 7a30d88
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 8 deletions.
44 changes: 43 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,27 @@ jobs:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
CREEK_KAFKA_VERSION: ${{ matrix.kafka_version }}
run: ./gradlew build coveralls
- name: Upload Checkstyle reports
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: checkstyle-reports-linux-${{ matrix.kafka_version }}
path: '**/build/reports/checkstyle/*.xml'
retention-days: 5
- name: Upload Spotbugs reports
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: spotbugs-reports-linux-${{ matrix.kafka_version }}
path: '**/build/reports/spotbugs/*.xml'
retention-days: 5
- name: Upload Test Results
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: test-results-linux-${{ matrix.kafka_version }}
path: '**/build/test-results/**/*.xml'
retention-days: 5
- name: Publish
if: matrix.publish && (github.event_name == 'push' || github.event.inputs.publish_artifacts == 'true')
env:
Expand Down Expand Up @@ -105,4 +126,25 @@ jobs:
- name: Create GitHut Release
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v0.1.15
with:
generate_release_notes: true
generate_release_notes: true
- name: Upload Checkstyle reports
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: checkstyle-reports-win
path: '**/build/reports/checkstyle/*.xml'
retention-days: 5
- name: Upload Spotbugs reports
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: spotbugs-reports-win
path: '**/build/reports/spotbugs/*.xml'
retention-days: 5
- name: Upload Test Results
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: test-results-win
path: '**/build/test-results/**/*.xml'
retention-days: 5
27 changes: 20 additions & 7 deletions buildSrc/src/main/kotlin/creek-common-convention.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* <p>Apply to all java modules, usually excluding the root project in multi-module sets.
*
* <p>Versions:
* - 1.12: XML reporting for spotbugs
* - 1.11: Add explicit checkstyle tool version
* - 1.10: Add ability to exclude containerised tests
* - 1.9: Add `allDeps` task.
Expand Down Expand Up @@ -59,7 +60,7 @@ repositories {

dependencies {
spotbugsPlugins("com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0")
checkstyle("com.puppycrawl.tools:checkstyle:10.12.5")
checkstyle("com.puppycrawl.tools:checkstyle:10.17.0")
}

configurations.all {
Expand Down Expand Up @@ -107,15 +108,27 @@ spotbugs {
excludeFilter.set(rootProject.file("config/spotbugs/suppressions.xml"))

tasks.spotbugsMain {
reports.create("html") {
required.set(true)
setStylesheet("fancy-hist.xsl")
reports {
create("html") {
required.set(true)
setStylesheet("fancy-hist.xsl")
}

create("xml") {
required.set(true)
}
}
}
tasks.spotbugsTest {
reports.create("html") {
required.set(true)
setStylesheet("fancy-hist.xsl")
reports {
create("html") {
required.set(true)
setStylesheet("fancy-hist.xsl")
}

create("xml") {
required.set(true)
}
}
}
}
Expand Down

0 comments on commit 7a30d88

Please sign in to comment.