Skip to content

Commit

Permalink
[CI] Ensure CI-PR builds all modified modules and their dependendants…
Browse files Browse the repository at this point in the history
…. [skip ci]
  • Loading branch information
corneil committed Jun 3, 2024
1 parent 0ea5618 commit b2800d3
Showing 1 changed file with 8 additions and 25 deletions.
33 changes: 8 additions & 25 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,44 +76,27 @@ jobs:
MAVEN_OPTS="-X $MAVEN_OPTS"
fi
for module in $MODULES; do
if [[ "$module" == *"/"* ]]; then
if [ "$FOLDERS" = "" ]; then
FOLDERS="$module"
else
FOLDERS="$FOLDERS,$module"
fi
if [ "$FOLDERS" = "" ]; then
FOLDERS="$module"
else
if [ "$ROOT_MODULES" == "" ]; then
ROOT_MODULES=$module
else
ROOT_MODULES="$ROOT_MODULES,$module"
fi
FOLDERS="$FOLDERS,$module"
fi
done
set +e
if [ "$ROOT_MODULES" != "" ]; then
# Module with no / are probably a root module that contains other modules and will trigger a lot of dependant builds without real value
echo "::info ::building $ROOT_MODULES"
echo "::debug ::MAVEN:./mvnw $MAVEN_OPTS -pl $ROOT_MODULES install"
./mvnw $MAVEN_OPTS -pl $ROOT_MODULES install
RC=$?
if ((RC!=0)); then
exit $RC
fi
fi
if [ "$FOLDERS" != "" ]; then
echo "::info ::verify $FOLDERS and dependents"
echo "::info ::install $FOLDERS and dependents"
echo "::debug ::MAVEN:./mvnw $MAVEN_OPTS -amd -pl $FOLDERS install"
./mvnw $MAVEN_OPTS -amd -pl $FOLDERS install
RC=$?
if ((RC!=0)); then
exit $RC
fi
fi
PWD=$(pwd)
# Build any applications that was compiled but don't deploy to artifactory.
PROCESSORS=$(find ./applications/processor -name target -exec ./parent-dir '{}' \;)
SINKS=$(find ./applications/sink -name target -exec ./parent-dir '{}' \;)
SOURCES=$(find ./applications/source -name target -exec ./parent-dir '{}' \;)
PROCESSORS=$(find ./applications/processor -name target -exec $PWD/parent-dir.sh '{}' \;)
SINKS=$(find ./applications/sink -name target -exec $PWD/parent-dir.sh '{}' \;)
SOURCES=$(find ./applications/source -name target -exec $PWD/parent-dir.sh '{}' \;)
# true as 3rd argument ensures that jars aren't deployed and containers aren't built.
for appdir in $PROCESSORS; do
./build-app.sh . "./$appdir" true
Expand Down

0 comments on commit b2800d3

Please sign in to comment.