Skip to content

Commit

Permalink
Latest build conv (#314)
Browse files Browse the repository at this point in the history
* Latest build conv
  • Loading branch information
big-andy-coates authored Aug 18, 2023
1 parent 4108212 commit 32f95bf
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 137 deletions.
16 changes: 15 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
tags: [ "v*.*.*" ]
pull_request:
branches: [ main ]
schedule:
- cron: "39 5 1,15 * *"
workflow_dispatch:
inputs:
publish_artifacts:
Expand All @@ -26,6 +28,15 @@ jobs:
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 # v1.1.0
- name: Dependency Review
uses: actions/dependency-review-action@v3
with:
comment-summary-in-pr: true
# Think carefully about the implications of adding dependencies with new licence types.
# Licence ids: https://spdx.org/licenses/
# License risks: https://brainhub.eu/library/open-source-licenses-to-avoid
allow-licenses:
Apache-2.0, MIT
- 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 @@ -36,7 +47,10 @@ jobs:
with:
java-version: '17'
distribution: 'adopt'
cache: gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2.7.0
with:
gradle-home-cache-cleanup: true
- name: Build
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ jobs:
with:
java-version: '17'
distribution: 'adopt'
cache: gradle

- name: Setup Gradle
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2.7.0
with:
gradle-home-cache-cleanup: true

- name: Build
run: ./gradlew test
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
name: Dependabot
on:
pull_request:
branches:
- main
branches: [ main ]

permissions:
contents: read
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Dependencies

on:
push:
branches: [ main ]
tags: [ "v*.*.*" ]
schedule:
- cron: "39 5 1,15 * *"
pull_request:
branches: [ main ]

permissions: read-all

jobs:
submit-dependencies:
permissions:
contents: write # required to submit dependencies report
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
- uses: gradle/wrapper-validation-action@56b90f209b02bf6d1deae490e9ef18b21a389cd4 # v1.1.0
- name: Set up JDK
uses: actions/setup-java@cd89f46ac9d01407894225f350157564c9c7cee2 # v3.12.0
with:
java-version: '17'
distribution: 'adopt'
- name: Setup Gradle
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2.7.0
with:
dependency-graph: generate-and-submit
gradle-home-cache-cleanup: true
- name: Generate dependency report
env:
DEPENDENCY_GRAPH_INCLUDE_CONFIGURATIONS: runtimeClasspath
DEPENDENCY_GRAPH_INCLUDE_PROJECTS: "^:(?!(buildSrc|test-)).*"
run: ./gradlew allDeps --configuration runtimeClasspath

6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ jobs:
with:
java-version: '17'
distribution: 'adopt'
cache: gradle

- name: Setup Gradle
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2.7.0
with:
gradle-home-cache-cleanup: true
- name: Ensure build is green
run: ./gradlew build
- name: Release
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ jobs:
with:
java-version: '17'
distribution: 'adopt'
cache: gradle

- name: Setup Gradle
uses: gradle/gradle-build-action@a4cf152f482c7ca97ef56ead29bf08bcd953284c # v2.7.0
with:
gradle-home-cache-cleanup: true
- name: Increment version
if: contains(fromJson('["Major", "Minor", "Patch"]'), github.event.inputs.part)
run: |
Expand Down
3 changes: 3 additions & 0 deletions buildSrc/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@
* limitations under the License.
*/

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.4.0"
}
21 changes: 16 additions & 5 deletions buildSrc/src/main/kotlin/creek-common-convention.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
*
* <p>Apply to all java modules, usually excluding the root project in multi-module sets.
*
* <p>Version: 1.7
* <p>Version: 1.8
* - 1.9: Add `allDeps` task.
* - 1.8: Tweak test config to reduce build speed.
* - 1.7: Switch to setting Java version via toolchain
* - 1.6: Remove GitHub packages for snapshots
* - 1.5: Add filters to exclude generated sources
Expand Down Expand Up @@ -70,8 +72,8 @@ tasks.withType<JavaCompile> {

tasks.test {
useJUnitPlatform()
setForkEvery(1)
maxParallelForks = 4
setForkEvery(5)
maxParallelForks = Runtime.getRuntime().availableProcessors()
testLogging {
showStandardStreams = true
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
Expand Down Expand Up @@ -117,17 +119,26 @@ if (rootProject.name != project.name) {
}
}

tasks.register("format") {
val format = tasks.register("format") {
group = "creek"
description = "Format the code"

dependsOn("spotlessCheck", "spotlessApply")
}

tasks.register("static") {
val static = tasks.register("static") {
group = "creek"
description = "Run static code analysis"

dependsOn("checkstyleMain", "checkstyleTest", "spotbugsMain", "spotbugsTest")

shouldRunAfter(format)
}

tasks.test {
shouldRunAfter(static)
}

// See: https://solidsoft.wordpress.com/2014/11/13/gradle-tricks-display-dependencies-for-all-subprojects-in-multi-project-build/
tasks.register<DependencyReportTask>("allDeps") {}

Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ private void gracefulStop() {

if (container.isRunning()) {
LOGGER.warn(
"Failed to step {} ({}) after {} seconds",
"Failed to stop {} ({}) after {} seconds",
name,
imageName,
shutDownTimeOut.toSeconds());
Expand Down
25 changes: 0 additions & 25 deletions executor/src/test/resources/junit-platform.properties

This file was deleted.

25 changes: 0 additions & 25 deletions extension/src/test/resources/junit-platform.properties

This file was deleted.

25 changes: 0 additions & 25 deletions model/src/test/resources/junit-platform.properties

This file was deleted.

25 changes: 0 additions & 25 deletions parser/src/test/resources/junit-platform.properties

This file was deleted.

25 changes: 0 additions & 25 deletions test-util/src/test/resources/junit-platform.properties

This file was deleted.

0 comments on commit 32f95bf

Please sign in to comment.