Skip to content

Commit 87d4525

Browse files
committed
Capture and upload performance suite logs
1 parent ecb331f commit 87d4525

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

.github/workflows/performance-regressions.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,17 @@ jobs:
4747

4848
- name: Set results path
4949
shell: bash
50-
run: echo "PERFORMANCE_RESULTS_PATH=performance-results-${{ matrix.runner }}.json" >> "$GITHUB_ENV"
50+
run: |
51+
echo "PERFORMANCE_RESULTS_PATH=performance-results-${{ matrix.runner }}.json" >> "$GITHUB_ENV"
52+
echo "PERFORMANCE_LOG_PATH=performance-suite-${{ matrix.runner }}.log" >> "$GITHUB_ENV"
5153
5254
- name: Run performance suite
5355
id: performance_suite
5456
continue-on-error: true
55-
run: cargo run --release -p cap-test -- suite performance --recording-path performance-fixtures/reference-recording.cap --duration 8 --output "$PERFORMANCE_RESULTS_PATH" --gate
57+
shell: bash
58+
run: |
59+
set -o pipefail
60+
cargo run --release -p cap-test -- suite performance --recording-path performance-fixtures/reference-recording.cap --duration 8 --output "$PERFORMANCE_RESULTS_PATH" 2>&1 | tee "$PERFORMANCE_LOG_PATH"
5661
5762
- name: Upload results
5863
if: always()
@@ -61,6 +66,13 @@ jobs:
6166
name: performance-results-${{ matrix.runner }}
6267
path: ${{ github.workspace }}/${{ env.PERFORMANCE_RESULTS_PATH }}
6368

69+
- name: Upload suite log
70+
if: always()
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: performance-log-${{ matrix.runner }}
74+
path: ${{ github.workspace }}/${{ env.PERFORMANCE_LOG_PATH }}
75+
6476
- name: Print results
6577
if: always()
6678
shell: bash
@@ -72,12 +84,16 @@ jobs:
7284
fi
7385
7486
- name: Enforce suite gate
75-
if: always() && steps.performance_suite.outcome != 'success'
87+
if: always()
7688
shell: bash
7789
run: |
7890
if [ -f "$PERFORMANCE_RESULTS_PATH" ]; then
7991
target/release/cap-test report "$PERFORMANCE_RESULTS_PATH"
92+
node -e 'const fs = require("fs"); const p = process.env.PERFORMANCE_RESULTS_PATH; const r = JSON.parse(fs.readFileSync(p, "utf8")); process.exit((r.summary.failed || r.summary.errors) ? 1 : 0);'
8093
else
8194
echo "$PERFORMANCE_RESULTS_PATH not found"
95+
if [ -f "$PERFORMANCE_LOG_PATH" ]; then
96+
cat "$PERFORMANCE_LOG_PATH"
97+
fi
98+
exit 1
8299
fi
83-
exit 1

0 commit comments

Comments
 (0)