Fix GitLab CI YAML syntax for perf-aggregate-report job

Convert complex shell commands to multi-line blocks to fix YAML parsing:
- Changed `test -z "$VAR" && ... || true` patterns to proper if/else blocks
- Used `|` syntax for multi-line shell scripts
- Fixed variable expansion in $FILES for build/un command
- Separated git diff --cached logic into if/else block

This resolves the error:
"jobs:perf-aggregate-report:script config should be a string or
a nested array of strings up to 10 levels deep"

YAML validated successfully with Python yaml.safe_load()
This commit is contained in:
russell@unturf.com 2026-01-19 14:01:05 -05:00
parent 1f83eaf175
commit 03529310c6

View file

@ -296,19 +296,36 @@ perf-aggregate-report:
- VERSIONS=$(git tag | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | sort -V)
- echo "Found tagged releases:"
- echo "$VERSIONS"
- test -z "$VERSIONS" && echo "ERROR - No version tags found" && exit 1 || true
- |
if [ -z "$VERSIONS" ]; then
echo "ERROR - No version tags found"
exit 1
fi
- echo "Step 2 - Copying perf.json files for tagged releases..."
- for v in $VERSIONS; do if [ -f "reports/$v/perf.json" ]; then cp "reports/$v/perf.json" "perf-$v.json"; echo " ✓ $v"; fi; done
- FILES=$(ls perf-*.json 2>/dev/null | sed 's/^/-f /' | tr '\n' ' ')
- test -z "$FILES" && echo "ERROR - No perf JSON files found" && exit 1 || true
- |
FILES=$(ls perf-*.json 2>/dev/null | sed 's/^/-f /' | tr '\n' ' ')
if [ -z "$FILES" ]; then
echo "ERROR - No perf JSON files found"
exit 1
fi
- echo "Step 3 - Generating charts via UN..."
- test -x build/un && build/un -a $FILES scripts/generate-aggregated-charts.py || echo "WARN - Charts skipped (build/un missing)"
- |
if [ -x build/un ]; then
build/un -a $FILES scripts/generate-aggregated-charts.py
else
echo "WARN - Charts skipped (build/un missing)"
fi
- rm -f perf-*.json
- mv -f *.png reports/ 2>/dev/null || true
- echo "Step 4 - Generating markdown report..."
- python3 scripts/aggregate-performance-reports.py reports AGGREGATED-PERFORMANCE.md
- echo "Step 5 - Setting up git..."
- test -z "$DEPLOY_KEY" && echo "WARN - No DEPLOY_KEY, skipping commit" && exit 0 || true
- |
if [ -z "$DEPLOY_KEY" ]; then
echo "WARN - No DEPLOY_KEY, skipping commit"
exit 0
fi
- mkdir -p ~/.ssh
- echo "$DEPLOY_KEY" | base64 -d > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
@ -320,7 +337,12 @@ perf-aggregate-report:
- git checkout -B main origin/main
- echo "Step 6 - Committing aggregated report..."
- git add reports/ AGGREGATED-PERFORMANCE.md
- git diff --cached --quiet && echo "No changes to commit" || git commit -m "perf: Update aggregated performance analysis [ci skip]"
- |
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "perf: Update aggregated performance analysis [ci skip]"
fi
- git push origin main || echo "Nothing to push"
- echo "✓ Aggregated report generated with charts"
- ls -lh AGGREGATED-PERFORMANCE.md