Skip to content

Commit ae2d3f2

Browse files
committed
ci(e2e-report): fix workflow test results file path
The e2e-report site reads the data file from `e2e-report/data/test-results.json`. The CI workflow was downloading an artifact called `latest-test-results.json` into the right directory but without renaming it. We didn't notice for some time because we have a committed file at the expected, and we'd been regularly updating it while actively working on the e2e-report site. While I was at it, I made this a bit clearer and replaced the hardcoded Next.js version with a selector input.
1 parent 044fc00 commit ae2d3f2

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

.github/workflows/e2e-report.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ on:
77
use-branch:
88
description: 'Enable if you want to test data from your selected branch instead of the scheduled test runs from Main'
99
type: boolean
10+
version:
11+
description: 'Version of Next.js (most recent test run must have included this version)'
12+
type: choice
13+
options:
14+
- 'latest'
15+
- 'canary'
16+
- '13.5.1'
17+
default: 'latest'
1018

1119
env:
1220
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
@@ -27,12 +35,15 @@ jobs:
2735
E2E_RUN_ID=$(gh run list -w test-e2e.yml -e schedule -s success --json databaseId --jq ".[0].databaseId" --repo $GITHUB_REPOSITORY)
2836
fi
2937
echo "runId=$E2E_RUN_ID" >> $GITHUB_OUTPUT
30-
- name: Download latest e2e results
38+
- name: Download e2e results
3139
if: ${{ steps.get-run-id.outputs.runId }}
3240
run: |
33-
echo "Downloading latest test results from run https://github.com/netlify/next-runtime/actions/runs/${{ steps.get-run-id.outputs.runId }}"
34-
rm e2e-report/data/test-results.json
35-
gh run download ${{ steps.get-run-id.outputs.runId }} -n "latest-test-results.json" -D e2e-report/data/ --repo $GITHUB_REPOSITORY
41+
version="${{ inputs.version }}"
42+
version=${version:-latest}
43+
echo "Downloading ${version} test results from run https://github.com/netlify/next-runtime/actions/runs/${{ steps.get-run-id.outputs.runId }}"
44+
artifact_name="${version}-test-results.json"
45+
gh run download ${{ steps.get-run-id.outputs.runId }} -n "${artifact_name}" --repo $GITHUB_REPOSITORY
46+
mv "${artifact_name}" e2e-report/data/test-results.json
3647
- name: Install site dependencies
3748
if: success()
3849
run: |

0 commit comments

Comments
 (0)