mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 16:25:49 +00:00
Update maven-build.yml
This commit is contained in:
parent
de688fe4a3
commit
7b9c12a93d
1 changed files with 20 additions and 23 deletions
43
.github/workflows/maven-build.yml
vendored
43
.github/workflows/maven-build.yml
vendored
|
@ -1,29 +1,26 @@
|
||||||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
name: Print Changed Folders
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
|
||||||
|
|
||||||
name: Java CI with Maven
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches:
|
||||||
pull_request:
|
- main
|
||||||
branches: [ main ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
print-changed-folders:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
java: [ '17' ]
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- name: Checkout code
|
||||||
- name: Set up JDK ${{matrix.java}}
|
uses: actions/checkout@v2
|
||||||
uses: actions/setup-java@v2
|
|
||||||
with:
|
- name: Check for changes in apps folder
|
||||||
java-version: ${{matrix.java}}
|
id: check-changes
|
||||||
distribution: 'adopt'
|
run: |
|
||||||
cache: maven
|
CHANGED_FOLDERS=$(git diff --name-only HEAD^ HEAD | grep '^apps/' | cut -d/ -f2- | cut -d/ -f1 | sort -u)
|
||||||
- name: Build with Maven Wrapper
|
echo "::set-output name=folders::$CHANGED_FOLDERS"
|
||||||
run: ./mvnw -B package
|
|
||||||
|
- name: Print folder names
|
||||||
|
run: |
|
||||||
|
echo "Changed folders:"
|
||||||
|
IFS=$'\n' read -rd '' -a FOLDERS <<< "${{ steps.check-changes.outputs.folders }}"
|
||||||
|
for folder in "${FOLDERS[@]}"; do
|
||||||
|
echo "- $folder"
|
||||||
|
done
|
||||||
|
|
Loading…
Reference in a new issue