Skip to content

Commit

Permalink
Add Pulsar 4.0.x compatibility tests
Browse files Browse the repository at this point in the history
Adds the ability to specify the Pulsar client version when running
the samples apps. Uses this new capability to add entries to the
check-samples.yml compatability test matrix to include Pulsar
4.0.x.

See #923
  • Loading branch information
onobc committed Dec 13, 2024
1 parent 475c515 commit 96d3e56
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 9 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/check-samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
runjobs: ${{ steps.continue.outputs.runjobs }}
project_version: ${{ steps.continue.outputs.project_version }}
boot_version: ${{ steps.continue.outputs.boot_version }}
pulsar_version: ${{ steps.continue.outputs.pulsar_version }}
steps:
- uses: actions/checkout@v4
- id: continue
Expand All @@ -32,6 +33,8 @@ jobs:
echo "project_version=$version" >>$GITHUB_OUTPUT
bootVersion=$(cat gradle/libs.versions.toml | grep "spring-boot = \"" | cut -d '"' -f2)
echo "boot_version=$bootVersion" >>$GITHUB_OUTPUT
pulsarVersion=$(cat gradle/libs.versions.toml | grep "pulsar = \"" | cut -d '"' -f2)
echo "pulsar_version=$pulsarVersion" >>$GITHUB_OUTPUT
check_samples:
name: Check Samples project
needs: [prerequisites]
Expand All @@ -41,14 +44,37 @@ jobs:
- javaVersion: 17
springBootVersion: "${{ needs.prerequisites.outputs.boot_version }}"
springPulsarVersion: "${{ needs.prerequisites.outputs.project_version }}"
pulsarVersion: "${{ needs.prerequisites.outputs.pulsar_version }}"
samplesTarget: ':runAllSampleTests'
- javaVersion: 21
springBootVersion: "${{ needs.prerequisites.outputs.boot_version }}"
springPulsarVersion: "${{ needs.prerequisites.outputs.project_version }}"
pulsarVersion: "${{ needs.prerequisites.outputs.pulsar_version }}"
samplesTarget: ':runAllSampleTests -x :spring-pulsar-sample-apps:sample-pulsar-functions:sample-signup-function:test'
- javaVersion: 17
springBootVersion: "3.2.3-SNAPSHOT"
springPulsarVersion: "1.0.0-SNAPSHOT"
springBootVersion: "${{ needs.prerequisites.outputs.boot_version }}"
springPulsarVersion: "${{ needs.prerequisites.outputs.project_version }}"
pulsarVersion: "3.2.4"
samplesTarget: ':runAllSampleTests'
- javaVersion: 17
springBootVersion: "${{ needs.prerequisites.outputs.boot_version }}"
springPulsarVersion: "${{ needs.prerequisites.outputs.project_version }}"
pulsarVersion: "4.0.1"
samplesTarget: ':runAllSampleTests'
- javaVersion: 17
springBootVersion: "3.3.7-SNAPSHOT"
springPulsarVersion: "1.1.7-SNAPSHOT"
pulsarVersion: "3.2.4"
samplesTarget: ':runAllSampleTests'
- javaVersion: 17
springBootVersion: "3.3.7-SNAPSHOT"
springPulsarVersion: "1.1.7-SNAPSHOT"
pulsarVersion: "3.3.3"
samplesTarget: ':runAllSampleTests'
- javaVersion: 17
springBootVersion: "3.3.7-SNAPSHOT"
springPulsarVersion: "1.1.7-SNAPSHOT"
pulsarVersion: "4.0.1"
samplesTarget: ':runAllSampleTests'
runs-on: ubuntu-latest
if: needs.prerequisites.outputs.runjobs
Expand All @@ -60,6 +86,7 @@ jobs:
LOCAL_REPOSITORY_PATH: ${{ github.workspace }}/build/publications/repos
VERSION: ${{ matrix.springPulsarVersion }}
BOOT_VERSION: ${{ matrix.springBootVersion }}
PULSAR_VERSION: ${{ matrix.pulsarVersion }}
JAVA_VERSION: ${{ matrix.javaVersion }}
run: |
./gradlew publishMavenJavaPublicationToLocalRepository
Expand All @@ -68,6 +95,7 @@ jobs:
-PlocalRepositoryPath="$LOCAL_REPOSITORY_PATH" \
-PspringPulsarVersion="$VERSION" \
-PspringBootVersion="$BOOT_VERSION" \
-PpulsarVersion="$PULSAR_VERSION" \
-PtestToolchain="$JAVA_VERSION" \
-PsampleTests \
${{ matrix.samplesTarget }}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
}

def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
def pulsarVersion = project.properties['pulsarVersion'] ?: versionCatalog.findVersion("pulsar").orElseThrow().displayName

ext['spring-pulsar.version'] = "${project.property('version.samples')}"
ext['pulsar.version'] = "${pulsarVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
}

def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
def pulsarVersion = project.properties['pulsarVersion'] ?: versionCatalog.findVersion("pulsar").orElseThrow().displayName

ext['spring-pulsar.version'] = "${project.property('version.samples')}"
ext['pulsar.version'] = "${pulsarVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
}

def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
def pulsarVersion = project.properties['pulsarVersion'] ?: versionCatalog.findVersion("pulsar").orElseThrow().displayName
def springCloudStreamVersion = versionCatalog.findVersion("spring-cloud-stream").orElseThrow().displayName

ext['spring-pulsar.version'] = "${project.property('version.samples')}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ repositories {

def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
def springCloudStreamVersion = versionCatalog.findVersion("spring-cloud-stream").orElseThrow().displayName
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
def pulsarVersion = project.properties['pulsarVersion'] ?: versionCatalog.findVersion("pulsar").orElseThrow().displayName

ext['spring-pulsar.version'] = "${project.property('version.samples')}"
ext['pulsar.version'] = "${pulsarVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repositories {
}

def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
def pulsarVersion = project.properties['pulsarVersion'] ?: versionCatalog.findVersion("pulsar").orElseThrow().displayName

dependencies {
implementation "org.apache.pulsar:pulsar-client-all:${pulsarVersion}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
}

def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
def pulsarVersion = project.properties['pulsarVersion'] ?: versionCatalog.findVersion("pulsar").orElseThrow().displayName

ext['spring-pulsar.version'] = "${project.property('version.samples')}"
ext['pulsar.version'] = "${pulsarVersion}"
Expand Down
2 changes: 1 addition & 1 deletion spring-pulsar-sample-apps/sample-reactive/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
}

def versionCatalog = extensions.getByType(VersionCatalogsExtension).named("libs")
def pulsarVersion = versionCatalog.findVersion("pulsar").orElseThrow().displayName
def pulsarVersion = project.properties['pulsarVersion'] ?: versionCatalog.findVersion("pulsar").orElseThrow().displayName
def pulsarReactiveVersion = versionCatalog.findVersion("pulsar-reactive").orElseThrow().displayName

ext['spring-pulsar.version'] = "${project.property('version.samples')}"
Expand Down

0 comments on commit 96d3e56

Please sign in to comment.