Skip to content

Commit

Permalink
Latest build conventions (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
big-andy-coates committed Jun 24, 2024
1 parent ac260ec commit 5dc3618
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 12 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ permissions:
contents: read

jobs:
build:
build_linux:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: gradle/wrapper-validation-action@216d1ad2b3710bf005dc39237337b9673fd8fcd5 # v3.3.2
- uses: gradle/wrapper-validation-action@88425854a36845f9c881450d9660b5fd46bee142 # v3.4.2
- name: Fetch version history
# Do NOT want to fetch all tags if building a specific tag.
# Doing so could result in code published with wrong version, if newer tags have been pushed
Expand All @@ -45,7 +45,21 @@ jobs:
- name: Build
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: ./gradlew build
run: ./gradlew build coveralls
- name: Upload Reports
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: reports-linux
path: '**/build/reports/**/*.xml'
retention-days: 5
- name: Upload Test Results
if: failure()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: test-results-linux
path: '**/build/test-results/**/*.xml'
retention-days: 5
- name: Publish
if: github.event_name == 'push' || github.event.inputs.publish_artifacts == 'true'
env:
Expand All @@ -69,7 +83,7 @@ jobs:
create-gh-release:
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, '-alpha')
needs: build
needs: build_linux
runs-on: ubuntu-latest
permissions:
contents: write
Expand Down
29 changes: 21 additions & 8 deletions buildSrc/src/main/kotlin/creek-common-convention.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022-2023 Creek Contributors (https://github.com/creek-service)
* Copyright 2022-2024 Creek Contributors (https://github.com/creek-service)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -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 5dc3618

Please sign in to comment.