mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 08:15: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
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||
|
||||
name: Java CI with Maven
|
||||
|
||||
name: Print Changed Folders
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
print-changed-folders:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
java: [ '17' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up JDK ${{matrix.java}}
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: ${{matrix.java}}
|
||||
distribution: 'adopt'
|
||||
cache: maven
|
||||
- name: Build with Maven Wrapper
|
||||
run: ./mvnw -B package
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check for changes in apps folder
|
||||
id: check-changes
|
||||
run: |
|
||||
CHANGED_FOLDERS=$(git diff --name-only HEAD^ HEAD | grep '^apps/' | cut -d/ -f2- | cut -d/ -f1 | sort -u)
|
||||
echo "::set-output name=folders::$CHANGED_FOLDERS"
|
||||
|
||||
- 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