Check Samples #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check Samples | |
on: | |
workflow_dispatch: | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
# GRADLE_ENTERPRISE_CACHE_USER: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }} | |
# GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }} | |
# GRADLE_ENTERPRISE_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 }} | |
steps: | |
- uses: actions/checkout@v3 | |
- 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 | |
check_samples: | |
name: Check Samples project | |
needs: [prerequisites] | |
runs-on: ubuntu-latest | |
if: needs.prerequisites.outputs.runjobs | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v2 | |
- name: Set up Java 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Setup Gradle user name | |
run: | | |
mkdir -p ~/.gradle | |
echo 'systemProp.user.name=spring-builds+github' >> ~/.gradle/gradle.properties | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
env: | |
GRADLE_USER_HOME: ~/.gradle | |
- name: Build and run unit tests | |
run: | | |
./gradlew clean build -x integrationTest -x test --info --stacktrace --no-build-cache publishMavenJavaPublicationToLocalRepository | |
# ./gradlew clean build -x integrationTest --continue --scan -PartifactoryUsername="$ARTIFACTORY_USERNAME" -PartifactoryPassword="$ARTIFACTORY_PASSWORD" | |
# - uses: actions/checkout@v3 | |
# - name: Set up gradle | |
# uses: spring-io/spring-gradle-build-action@v2 | |
# with: | |
# java-version: 17 | |
# distribution: temurin | |
# - name: Check samples project | |
# env: | |
# LOCAL_REPOSITORY_PATH: ${{ github.workspace }}/build/publications/repos | |
# VERSION: ${{ needs.prerequisites.outputs.project_version }} | |
# run: | | |
# ./gradlew --info --stacktrace --no-build-cache publishMavenJavaPublicationToLocalRepository |