Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build 📦
description: 'Builds the project, optionally publishing it to a local deployment repository'
inputs:
commercial-release-repository-url:
Expand Down Expand Up @@ -50,7 +50,7 @@ outputs:
runs:
using: composite
steps:
- name: Prepare Gradle Build
- name: Prepare Gradle Build ⚙️
uses: ./.github/actions/prepare-gradle-build
with:
cache-read-only: ${{ inputs.gradle-cache-read-only }}
Expand All @@ -59,7 +59,7 @@ runs:
java-early-access: ${{ inputs.java-early-access }}
java-toolchain: ${{ inputs.java-toolchain }}
java-version: ${{ inputs.java-version }}
- name: Build
- name: Sanity Build 📦
id: build
if: ${{ inputs.publish == 'false' }}
shell: bash
Expand All @@ -68,8 +68,19 @@ runs:
COMMERCIAL_REPO_PASSWORD: ${{ inputs.commercial-repository-password }}
COMMERCIAL_REPO_USERNAME: ${{ inputs.commercial-repository-username }}
COMMERCIAL_SNAPSHOT_REPO_URL: ${{ inputs.commercial-snapshot-repository-url }}
run: ./gradlew build
- name: Publish
# run: ./gradlew build
run: ./gradlew rewriteDryRun build -Dorg.gradle.jvmargs=-Xmx12G
- name: Sanity Check 🦢
id: sanity
if: ${{ inputs.publish == 'false' }}
shell: bash
env:
COMMERCIAL_RELEASE_REPO_URL: ${{ inputs.commercial-release-repository-url }}
COMMERCIAL_REPO_PASSWORD: ${{ inputs.commercial-repository-password }}
COMMERCIAL_REPO_USERNAME: ${{ inputs.commercial-repository-username }}
COMMERCIAL_SNAPSHOT_REPO_URL: ${{ inputs.commercial-snapshot-repository-url }}
run: ./gradlew rewriteDryRun -Dorg.gradle.jvmargs=-Xmx12G
- name: Publish 📡
id: publish
if: ${{ inputs.publish == 'true' }}
shell: bash
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-deploy-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
if: ${{ github.repository == 'spring-projects/spring-boot' || github.repository == 'spring-projects/spring-boot-commercial' }}
runs-on: ${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Build and Publish
- name: Build 📦 and Publish 📡
id: build-and-publish
uses: ./.github/actions/build
with:
Expand Down
31 changes: 17 additions & 14 deletions .github/workflows/build-pull-request.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
name: Build Pull Request
name: Build Pull Request 🏭️
on: pull_request
permissions:
contents: read
jobs:
build:
name: Build Pull Request
if: ${{ github.repository == 'spring-projects/spring-boot' }}
name: Sanity Build 🕊️📦
# if: ${{ github.repository == 'spring-projects/spring-boot' }}
runs-on: ${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Build
- name: Sanity Build 🕊️📦
id: build
uses: ./.github/actions/build
- name: Print JVM Thread Dumps When Cancelled
if: cancelled()
uses: ./.github/actions/print-jvm-thread-dumps
- name: Upload Build Reports
if: failure()
uses: actions/upload-artifact@v6
with:
name: build-reports
path: '**/build/reports/'
# - name: Log Potentially Canceled JVM Thread Dumps 📋
# if: cancelled()
# uses: ./.github/actions/print-jvm-thread-dumps
# - name: Upload Build Report 📊
# if: failure()
# uses: actions/upload-artifact@v6
# with:
# name: build-reports
# path: '**/build/reports/'
# - name: Sanity 🕊️
# id: sanity
# uses: ./.github/actions/build
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ jobs:
git config --global core.autocrlf true
git config --global core.longPaths true
Stop-Service -name Docker
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Build
- name: Build 📦
id: build
uses: ./.github/actions/build
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/distribute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ permissions:
contents: read
jobs:
distribute-spring-enterprise-release-bundle:
name: Distribute Release Bundle 📦
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Create Bundle
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ jobs:
if: ${{ github.repository == 'spring-projects/spring-boot' }}
runs-on: ${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Build and Publish
- name: Build 📦 and Publish 📡
id: build-and-publish
uses: ./.github/actions/build
with:
Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
- verify
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Sync to Maven Central
uses: ./.github/actions/sync-to-maven-central
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- sync-to-maven-central
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Publish
uses: ./.github/actions/publish-gradle-plugin
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
- trigger-docs-build
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Create GitHub Release
uses: ./.github/actions/create-github-release
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
if: ${{ github.repository == 'spring-projects/spring-boot' || github.repository == 'spring-projects/spring-boot-commercial' }}
runs-on: ${{ vars.UBUNTU_MEDIUM || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Build and Publish
- name: Build 📦 and Publish 📡
id: build-and-publish
uses: ./.github/actions/build
with:
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- verify
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: actions/checkout@v6
uses: actions/check-out@v6

accoding to kebak-case command uses one word just like git itself.

- name: Sync to Maven Central
uses: ./.github/actions/sync-to-maven-central
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
- sync-to-maven-central
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Publish
uses: ./.github/actions/publish-gradle-plugin
Expand All @@ -121,7 +121,7 @@ jobs:
- sync-to-maven-central
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Publish to SDKMAN!
uses: ./.github/actions/publish-to-sdkman
Expand All @@ -137,7 +137,7 @@ jobs:
- sync-to-maven-central
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Update Homebrew Tap
uses: ./.github/actions/update-homebrew-tap
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:
- update-homebrew-tap
runs-on: ${{ vars.UBUNTU_SMALL || 'ubuntu-latest' }}
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Create GitHub Release
uses: ./.github/actions/create-github-release
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/run-codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: "Run CodeQL Analysis"
name: Run CodeQL Analysis 📊
on:
push:
pull_request:
workflow_dispatch:
permissions: read-all
jobs:
run-analysis:
name: Inspect 🔎
permissions:
actions: read
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- version: 21
toolchain: true
steps:
- name: Check Out Code
- name: Checkout Code 📥
uses: actions/checkout@v6
- name: Prepare Gradle Build
uses: ./.github/actions/prepare-gradle-build
Expand Down
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

plugins {
id "base"
id "org.openrewrite.rewrite" version "7.23.0" apply false
}

description = "Spring Boot Build"
Expand Down Expand Up @@ -46,3 +47,5 @@ subprojects {
resolutionStrategy.cacheChangingModulesFor 0, "minutes"
}
}

apply from: rootProject.file("gradle/plugins/config/sanity.gradle")
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ public String getDescription() {
* @return the cache, or {@code null} if it is not a volume cache
*/
public @Nullable Volume getVolume() {
return (this.format.equals(Format.VOLUME)) ? (Volume) this : null;
return (this.format == Format.VOLUME) ? (Volume) this : null;
}

/**
* Return the details of the cache if it is a bind cache.
* @return the cache, or {@code null} if it is not a bind cache
*/
public @Nullable Bind getBind() {
return (this.format.equals(Format.BIND)) ? (Bind) this : null;
return (this.format == Format.BIND) ? (Bind) this : null;
}

/**
Expand Down Expand Up @@ -120,7 +120,7 @@ public boolean equals(@Nullable Object obj) {
return false;
}
Cache other = (Cache) obj;
return Objects.equals(this.format, other.format);
return this.format == other.format;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class TestCommand implements Command {
String help = "No options"

String usageHelp = "Not very useful"

Collection<String> optionsHelp = ["No options"]

boolean optionCommand = false

void run(String... args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Example implements CommandLineRunner {
private MyService myService

void run(String... args) {
println "Hello ${this.myService.sayWorld()} From ${getClass().getClassLoader().getResource('samples/app.groovy')}"
println "Hello ${this.myService.sayWorld()} From ${getClass().getClassLoader().getResource('samples/app.groovy')}"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
def foo() {
"Foo"
}

command("foo") { options ->
def foo = foo()
println "Hello ${foo} ${options.nonOptionArguments()}: ${options.has('foo')} ${options.valueOf('bar')}"
Expand Down
4 changes: 2 additions & 2 deletions cli/spring-boot-cli/src/test/resources/scripts/command.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class TestCommand implements Command {
String help = "No options"

String usageHelp = "Not very useful"

Collection<String> optionsHelp = ["No options"]

boolean optionCommand = false

void run(String... args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public String getAll() {
*/
@Override
public String getOut() {
return get(this.out, Type.OUT::equals);
return get(this.out, (v) -> v == Type.OUT);
}

/**
Expand All @@ -131,7 +131,7 @@ public String getOut() {
*/
@Override
public String getErr() {
return get(this.err, Type.ERR::equals);
return get(this.err, (v) -> v == Type.ERR);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ private void addToSources(MutablePropertySources sources, Type type, String name
}
}
Map<String, Object> source = new LinkedHashMap<>(this.properties);
sources.addFirst((type.equals(Type.MAP) ? new MapPropertySource(name, source)
sources.addFirst(((type == Type.MAP) ? new MapPropertySource(name, source)
: new SystemEnvironmentPropertySource(name, source)));
}

Expand Down
14 changes: 14 additions & 0 deletions gradle/plugins/config/sanity.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
project.apply(plugin: "org.openrewrite.rewrite")
dependencies {
rewrite("org.openrewrite.recipe:rewrite-static-analysis:2.24.0")
rewrite("org.openrewrite.recipe:rewrite-third-party:0.32.1")
}
repositories {
mavenCentral()
}
rewrite {
activeRecipe("org.springframework.boot.openrewrite.SanityCheck")
configFile = project.getRootProject().file("${rootDir}/gradle/plugins/config/sanity.yml")
setExportDatatables(true)
setFailOnDryRunResults(true)
}
Loading
Loading