Skip to content

Commit

Permalink
Add CI build on several Spring Framework generations
Browse files Browse the repository at this point in the history
This commit adds a GHA workflow that builds the project against a list
of configurable Spring Framework versions. The build action has been
updated to accept an additional input that tunes the Spring Framework
version the build is using

As a result, the default Spring Framework version of the project is now
configured in gradle.properties.

Closes gh-1810
  • Loading branch information
snicoll committed Oct 11, 2024
1 parent bedb949 commit 4022e4a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ inputs:
description: 'Whether to publish artifacts ready for deployment to Artifactory'
required: false
default: 'false'
spring-framework-version:
description: 'Spring Framework version to use'
required: false
outputs:
build-scan-url:
description: 'URL, if any, of the build scan produced by the build'
Expand All @@ -46,7 +49,7 @@ runs:
id: build
if: ${{ inputs.publish == 'false' }}
shell: bash
run: ./gradlew check
run: ./gradlew check ${{ inputs.spring-framework-version != '' && format('-PspringFrameworkVersion={0}', inputs.spring-framework-version) || '' }}
- name: Publish
id: publish
if: ${{ inputs.publish == 'true' }}
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
ci:
name: 'Java ${{ matrix.java.version}} | Spring Framework ${{ matrix.spring.generation}}'
if: ${{ github.repository == 'spring-projects/spring-webflow' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java:
- version: 17
toolchain: false
spring:
- generation: 6.1.x
version: 6.0.13
- generation: 6.2.x
version: 6.2.0-SNAPSHOT
steps:
- name: Check Out Code
uses: actions/checkout@v4
- name: Build
id: build
uses: ./.github/actions/build
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
java-early-access: ${{ matrix.java.early-access || 'false' }}
java-distribution: ${{ matrix.java.distribution }}
java-toolchain: ${{ matrix.java.toolchain }}
java-version: ${{ matrix.java.version }}
spring-framework-version: ${{ matrix.spring.version }}
- name: Send Notification
if: always()
uses: ./.github/actions/send-notification
with:
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
run-name: ${{ format('{0} | Java {1} | Spring Framework {2}', github.ref_name, matrix.java.version,matrix.spring.version) }}
status: ${{ job.status }}
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ allprojects {

dependencyManagement {
imports {
mavenBom "org.springframework:spring-framework-bom:6.0.7"
mavenBom "org.springframework:spring-framework-bom:${springFrameworkVersion}"
mavenBom "org.springframework.security:spring-security-bom:6.0.2"
mavenBom "org.junit:junit-bom:5.7.2"
}
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
version=3.0.1-SNAPSHOT
org.gradle.caching=true

springFrameworkVersion=6.0.7

0 comments on commit 4022e4a

Please sign in to comment.