fix: events should only be published once per content operation #1687
Workflow file for this run
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: PR Validation | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
spring_content_version: ${{ steps.build.outputs.spring_content_version }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
path: spring-content | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Build and Test | |
id: build | |
run: | | |
export AWS_REGION=us-west-1 | |
pushd spring-content | |
mvn -B -P tests -Dmaven.javadoc.skip=true install --file pom.xml | |
project_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
echo "spring_content_version=${project_version}" >> $GITHUB_OUTPUT | |
popd | |
- name: Save Maven Cache | |
id: cache-maven-save | |
uses: actions/cache/save@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-maven-${{ github.run_id }} | |
validate-with-examples: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Restore Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-maven-${{ github.run_id }} | |
- uses: actions/checkout@v2 | |
with: | |
path: spring-content | |
- name: Re-build spring-content | |
run: | | |
pushd spring-content | |
mvn install -DskipTests=true | |
popd | |
- uses: actions/checkout@v2 | |
with: | |
repository: paulcwarren/spring-content-examples | |
path: spring-content-examples | |
ref: refs/heads/main | |
- name: Validate against Examples | |
run: | | |
export AWS_REGION=us-west-1 | |
pushd spring-content-examples | |
git fetch --all | |
git checkout main | |
SPRING_CONTENT_VERSION=${{ needs.build.outputs.spring_content_version }} mvn -B clean install | |
popd | |
# - name: Setup tmate session if anything fails | |
# if: ${{ failure() }} | |
# uses: mxschmitt/action-tmate@v3 | |
# timeout-minutes: 360 | |
validate-with-gettingstarteds: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 17 | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
- name: Restore Maven packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2 | |
key: ${{ runner.os }}-maven-${{ github.run_id }} | |
- uses: actions/checkout@v2 | |
with: | |
repository: paulcwarren/spring-content-gettingstarted | |
path: spring-content-gettingstarted | |
ref: refs/heads/feat/content-preservation | |
- name: Validate against Getting Started Guides | |
run: | | |
export AWS_REGION=us-west-1 | |
pushd spring-content-gettingstarted | |
SPRING_CONTENT_VERSION=${{ needs.build.outputs.spring_content_version }} mvn -B clean install | |
popd |