Files
spring-pulsar/.github/workflows/check-samples.yml
Chris Bono df9d47a6a3 [CI] Remove 1.1.7 spring-pulsar from samples matrix
The 1.1.7-SNAPSHOT of spring-pulsar is not available in the current check samples workflow.
The reason is that it relies on local publish only.
Need to adjust the workflow to allow resolving dependencies out of the repo in the non-GA case.
2024-12-14 10:45:04 -06:00

87 lines
3.9 KiB
YAML

name: Check Samples
on:
workflow_dispatch:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
COMMIT_OWNER: ${{ github.event.pusher.name }}
COMMIT_SHA: ${{ github.sha }}
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
jobs:
prerequisites:
name: Pre-requisites for building
runs-on: ubuntu-latest
if: github.repository == 'spring-projects/spring-pulsar'
outputs:
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
name: Determine if should continue
run: |
# Run jobs if in upstream repository
echo "runjobs=true" >>$GITHUB_OUTPUT
# Extract version from gradle.properties
version=$(cat gradle.properties | grep "version=" | awk -F'=' '{print $2}')
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]
strategy:
matrix:
include:
- 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: "${{ 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'
runs-on: ubuntu-latest
if: needs.prerequisites.outputs.runjobs
steps:
- uses: actions/checkout@v4
- uses: spring-io/spring-gradle-build-action@v2
- name: Check samples project
env:
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
./gradlew \
--init-script ./spring-pulsar-sample-apps/sample-apps-check-ci.gradle \
-PlocalRepositoryPath="$LOCAL_REPOSITORY_PATH" \
-PspringPulsarVersion="$VERSION" \
-PspringBootVersion="$BOOT_VERSION" \
-PpulsarVersion="$PULSAR_VERSION" \
-PtestToolchain="$JAVA_VERSION" \
-PsampleTests \
${{ matrix.samplesTarget }}