Skip to content

Commit c7dc3ee

Browse files
committed
Use env var for performance results path
1 parent 8c016f7 commit c7dc3ee

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

.github/workflows/performance-regressions.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
- macos-latest
1515
- windows-latest
1616
runs-on: ${{ matrix.runner }}
17+
env:
18+
PERFORMANCE_RESULTS_PATH: performance-results-${{ runner.os }}.json
1719
steps:
1820
- name: Checkout Cap
1921
uses: actions/checkout@v4
@@ -48,32 +50,32 @@ jobs:
4850
- name: Run performance suite
4951
id: performance_suite
5052
continue-on-error: true
51-
run: cargo run --release -p cap-test -- suite performance --recording-path performance-fixtures/reference-recording.cap --duration 8 --output performance-results.json --gate
53+
run: cargo run --release -p cap-test -- suite performance --recording-path performance-fixtures/reference-recording.cap --duration 8 --output "$PERFORMANCE_RESULTS_PATH" --gate
5254

5355
- name: Upload results
5456
if: always()
5557
uses: actions/upload-artifact@v4
5658
with:
5759
name: performance-results-${{ matrix.runner }}
58-
path: performance-results.json
60+
path: ${{ env.PERFORMANCE_RESULTS_PATH }}
5961

6062
- name: Print results
6163
if: always()
6264
shell: bash
6365
run: |
64-
if [ -f performance-results.json ]; then
65-
cat performance-results.json
66+
if [ -f "$PERFORMANCE_RESULTS_PATH" ]; then
67+
cat "$PERFORMANCE_RESULTS_PATH"
6668
else
67-
echo "performance-results.json not found"
69+
echo "$PERFORMANCE_RESULTS_PATH not found"
6870
fi
6971
7072
- name: Enforce suite gate
7173
if: always() && steps.performance_suite.outcome != 'success'
7274
shell: bash
7375
run: |
74-
if [ -f performance-results.json ]; then
75-
target/release/cap-test report performance-results.json
76+
if [ -f "$PERFORMANCE_RESULTS_PATH" ]; then
77+
target/release/cap-test report "$PERFORMANCE_RESULTS_PATH"
7678
else
77-
echo "performance-results.json not found"
79+
echo "$PERFORMANCE_RESULTS_PATH not found"
7880
fi
7981
exit 1

0 commit comments

Comments
 (0)