fix: use find+while loop instead of multiline output in for loop
This commit is contained in:
@@ -36,19 +36,6 @@ jobs:
|
||||
- name: Install KFP
|
||||
run: pip install kfp==2.12.1
|
||||
|
||||
- name: Discover pipeline files
|
||||
id: discover
|
||||
run: |
|
||||
# Find all pipeline Python files
|
||||
FILES=$(find . -maxdepth 1 -name '*_pipeline.py' -o -name '*pipeline*.py' | sort)
|
||||
COUNT=$(echo "$FILES" | grep -c '.' || true)
|
||||
echo "files<<EOF" >> $GITHUB_OUTPUT
|
||||
echo "$FILES" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
echo "count=$COUNT" >> $GITHUB_OUTPUT
|
||||
echo "Found $COUNT pipeline files:"
|
||||
echo "$FILES"
|
||||
|
||||
- name: Compile pipelines
|
||||
id: compile
|
||||
run: |
|
||||
@@ -57,7 +44,7 @@ jobs:
|
||||
COMPILED_LIST=""
|
||||
FAILED_LIST=""
|
||||
|
||||
for py_file in ${{ steps.discover.outputs.files }}; do
|
||||
find . -maxdepth 1 -name '*_pipeline.py' | sort | while read -r py_file; do
|
||||
name=$(basename "$py_file" .py)
|
||||
echo "::group::Compiling $name"
|
||||
|
||||
@@ -81,19 +68,17 @@ jobs:
|
||||
echo "::endgroup::"
|
||||
done
|
||||
|
||||
# Re-count from produced files (pipe subshell loses vars)
|
||||
COMPILED=$(find . -maxdepth 1 -name '*_pipeline.yaml' | wc -l)
|
||||
TOTAL=$(find . -maxdepth 1 -name '*_pipeline.py' | wc -l)
|
||||
FAILED=$((TOTAL - COMPILED))
|
||||
|
||||
echo "compiled=$COMPILED" >> $GITHUB_OUTPUT
|
||||
echo "failed=$FAILED" >> $GITHUB_OUTPUT
|
||||
echo "compiled_list<<EOF" >> $GITHUB_OUTPUT
|
||||
echo -e "$COMPILED_LIST" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
echo "failed_list<<EOF" >> $GITHUB_OUTPUT
|
||||
echo -e "$FAILED_LIST" >> $GITHUB_OUTPUT
|
||||
echo "EOF" >> $GITHUB_OUTPUT
|
||||
|
||||
echo ""
|
||||
echo "=== Summary ==="
|
||||
echo "Compiled: $COMPILED"
|
||||
echo "Failed: $FAILED"
|
||||
echo "Compiled: $COMPILED / $TOTAL"
|
||||
|
||||
if [ "$FAILED" -gt 0 ]; then
|
||||
echo "::warning::$FAILED pipeline(s) failed to compile"
|
||||
|
||||
Reference in New Issue
Block a user