Upgrade Spring Boot & Gradle Wrapper versions across the board #530
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: Smoke Test Pull Request (Java) | |
on: | |
merge_group: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- 'java/**' | |
jobs: | |
prepare: | |
name: Prepare | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.paths.outputs.matrix }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Discover changed paths | |
id: paths | |
run: | | |
env | |
# see: https://stackoverflow.com/a/8721550/24069 for usage of paste | |
changed_java_folders=$( git diff --name-only --merge-base origin/$GITHUB_BASE_REF $GITHUB_SHA | xargs -n 1 dirname | sort -k 2 | uniq | grep -v "^\." ) | |
smoke_test_folders="" | |
while read -r changed_folder | |
do | |
echo "working on $changed_folder" | |
smoke_test="" | |
current_folder=$changed_folder | |
while [ -z "$smoke_test" ] && [ "$current_folder" != "." ] | |
do | |
echo "--smoke_test is $smoke_test" | |
echo "--current_folder is $current_folder" | |
if [[ -s $current_folder/smoke_test ]]; then | |
smoke_test="$current_folder/smoke_test" | |
else | |
current_folder=$(dirname $current_folder) | |
fi | |
done | |
if [ "$current_folder" != "." ]; then | |
smoke_test_folders="$smoke_test_folders\"$smoke_test\"\n" | |
fi | |
done <<<"$changed_java_folders" | |
smoke_test_folders=$( echo -e $smoke_test_folders | uniq | grep "\S" | paste -s -d, -) | |
echo "These are the Java folders where we found changes for this PR : $changed_java_folders" >> $GITHUB_STEP_SUMMARY | |
echo "These are the Java folders where we found changes AND the presence of smoke tests for this PR : $smoke_test_folders" >> $GITHUB_STEP_SUMMARY | |
echo "matrix={\"java_sample_folder\":[$smoke_test_folders]}" >> $GITHUB_OUTPUT | |
echo "This is how the matrix will look like: $(cat $GITHUB_OUTPUT)" | |
smoke: | |
needs: prepare | |
name: Smoke Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }} | |
steps: | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20.x | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Smoke Test Java samples | |
run: | | |
echo "About to run the smoke test script against this suite folder: ${{ matrix.java_sample_folder }}/smoke_test" | |
./scripts/smoke.sh --suite ${{ matrix.java_sample_folder }} \ | |
--builder paketobuildpacks/builder:base \ | |
--builder paketobuildpacks/builder:tiny |