fix: use find+while loop instead of multiline output in for loop

This commit is contained in:
2026-02-13 10:32:35 -05:00
parent 321eca5943
commit fc036b0e72

View File

@@ -36,19 +36,6 @@ jobs:
- name: Install KFP - name: Install KFP
run: pip install kfp==2.12.1 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 - name: Compile pipelines
id: compile id: compile
run: | run: |
@@ -57,7 +44,7 @@ jobs:
COMPILED_LIST="" COMPILED_LIST=""
FAILED_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) name=$(basename "$py_file" .py)
echo "::group::Compiling $name" echo "::group::Compiling $name"
@@ -81,19 +68,17 @@ jobs:
echo "::endgroup::" echo "::endgroup::"
done 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 "compiled=$COMPILED" >> $GITHUB_OUTPUT
echo "failed=$FAILED" >> $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 ""
echo "=== Summary ===" echo "=== Summary ==="
echo "Compiled: $COMPILED" echo "Compiled: $COMPILED / $TOTAL"
echo "Failed: $FAILED"
if [ "$FAILED" -gt 0 ]; then if [ "$FAILED" -gt 0 ]; then
echo "::warning::$FAILED pipeline(s) failed to compile" echo "::warning::$FAILED pipeline(s) failed to compile"