Skip to content

Commit 34073ac

Browse files
committed
check all the tests
1 parent 89442a6 commit 34073ac

File tree

2 files changed

+187
-149
lines changed

2 files changed

+187
-149
lines changed

.github/workflows/run-tests.yml

Lines changed: 174 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -44,76 +44,89 @@ jobs:
4444
echo "matrix=[\"latest\", \"canary\"]" >> $GITHUB_OUTPUT
4545
fi
4646
47-
# e2e:
48-
# needs: setup
49-
# runs-on: ubuntu-latest
50-
# strategy:
51-
# fail-fast: false
52-
# matrix:
53-
# version: ${{ fromJson(needs.setup.outputs.matrix) }}
54-
# shard: [1, 2, 3, 4, 5]
47+
e2e:
48+
needs: setup
49+
runs-on: ubuntu-latest
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
version: ${{ fromJson(needs.setup.outputs.matrix) }}
54+
shard: [1, 2, 3, 4, 5]
5555

56-
# steps:
57-
# - uses: actions/checkout@v5
58-
# - name: 'Install Node'
59-
# uses: actions/setup-node@v4
60-
# with:
61-
# node-version: '18.x'
62-
# cache: 'npm'
63-
# cache-dependency-path: '**/package-lock.json'
64-
# - uses: oven-sh/setup-bun@v2
65-
# - name: setup pnpm/yarn
66-
# run: |
67-
# npm install -g corepack
68-
# corepack enable
69-
# shell: bash
70-
# - name: Install Deno
71-
# uses: denoland/setup-deno@v1
72-
# with:
73-
# # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
74-
# deno-version: v2.2.4
75-
# - name: 'Install dependencies'
76-
# run: npm ci
77-
# - name: 'Prepare Netlify CLI'
78-
# env:
79-
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
80-
# run: |
81-
# # Control netlify-cli as a regular dev dep but expose it globally for test fixtures to use
82-
# npm install -g "netlify-cli@$(npm list --json --depth=0 netlify-cli | jq -r ".dependencies[\"netlify-cli\"].version")"
83-
# npx netlify login
84-
# - name: Get installed Playwright version
85-
# id: playwright-version
86-
# run: echo "version=$(npm view @playwright/test version)" >> $GITHUB_OUTPUT
87-
# - uses: actions/cache@v4
88-
# id: playwright-cache
89-
# with:
90-
# path: '~/.cache/ms-playwright'
91-
# key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}'
92-
# restore-keys: |
93-
# ${{ runner.os }}-playwright-
94-
# - name: Install Playwright Browsers
95-
# if: steps.playwright-cache.outputs.cache-hit != 'true'
96-
# run: npx playwright install --with-deps
97-
# - name: Resolve Next.js version
98-
# id: resolve-next-version
99-
# shell: bash
100-
# run: |
101-
# RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
102-
# echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
103-
# echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
104-
# - name: Run Playwright tests
105-
# run: npm run test:ci:e2e -- --shard=${{ matrix.shard }}/5
106-
# env:
107-
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
108-
# NEXT_VERSION: ${{ matrix.version }}
109-
# NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
110-
# - name: Upload blob report to GitHub Actions Artifacts
111-
# uses: actions/upload-artifact@v4
112-
# if: always()
113-
# with:
114-
# name: blob-report-${{matrix.version}}-${{ matrix.shard }}
115-
# path: blob-report
116-
# retention-days: 1
56+
steps:
57+
- uses: actions/checkout@v5
58+
- name: Decide Node Version
59+
id: decide-node-version
60+
shell: bash
61+
run: |
62+
NODE_VERSION=18.x
63+
if [ "${{ matrix.version}}" = "canary" ]; then
64+
# this is not ideal, because we set node@20 just when explicitly using canary tag as target
65+
# but next@canary are still on 15 major, so we can't yet use major version of resolved next version
66+
# as condition
67+
NODE_VERSION=20.x
68+
fi
69+
echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
70+
echo "Node version for 'next@${{ matrix.version }}' is '$NODE_VERSION'"
71+
- name: 'Install Node'
72+
uses: actions/setup-node@v4
73+
with:
74+
node-version: ${{ steps.decide-node-version.outputs.version }}
75+
cache: 'npm'
76+
cache-dependency-path: '**/package-lock.json'
77+
- uses: oven-sh/setup-bun@v2
78+
- name: setup pnpm/yarn
79+
run: |
80+
npm install -g corepack
81+
corepack enable
82+
shell: bash
83+
- name: Install Deno
84+
uses: denoland/setup-deno@v1
85+
with:
86+
# Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
87+
deno-version: v2.2.4
88+
- name: 'Install dependencies'
89+
run: npm ci
90+
- name: 'Prepare Netlify CLI'
91+
env:
92+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
93+
run: |
94+
# Control netlify-cli as a regular dev dep but expose it globally for test fixtures to use
95+
npm install -g "netlify-cli@$(npm list --json --depth=0 netlify-cli | jq -r ".dependencies[\"netlify-cli\"].version")"
96+
npx netlify login
97+
- name: Get installed Playwright version
98+
id: playwright-version
99+
run: echo "version=$(npm view @playwright/test version)" >> $GITHUB_OUTPUT
100+
- uses: actions/cache@v4
101+
id: playwright-cache
102+
with:
103+
path: '~/.cache/ms-playwright'
104+
key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}'
105+
restore-keys: |
106+
${{ runner.os }}-playwright-
107+
- name: Install Playwright Browsers
108+
if: steps.playwright-cache.outputs.cache-hit != 'true'
109+
run: npx playwright install --with-deps
110+
- name: Resolve Next.js version
111+
id: resolve-next-version
112+
shell: bash
113+
run: |
114+
RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
115+
echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
116+
echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
117+
- name: Run Playwright tests
118+
run: npm run test:ci:e2e -- --shard=${{ matrix.shard }}/5
119+
env:
120+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
121+
NEXT_VERSION: ${{ matrix.version }}
122+
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
123+
- name: Upload blob report to GitHub Actions Artifacts
124+
uses: actions/upload-artifact@v4
125+
if: always()
126+
with:
127+
name: blob-report-${{matrix.version}}-${{ matrix.shard }}
128+
path: blob-report
129+
retention-days: 1
117130

118131
test:
119132
needs: setup
@@ -211,87 +224,100 @@ jobs:
211224
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
212225
TEMP: ${{ github.workspace }}/..
213226

214-
# smoke:
215-
# if: always()
216-
# needs: setup
217-
# runs-on: ubuntu-latest
218-
# strategy:
219-
# fail-fast: false
220-
# matrix:
221-
# version: ${{ fromJson(needs.setup.outputs.matrix) }}
222-
# steps:
223-
# - uses: actions/checkout@v5
224-
# - name: 'Install Node'
225-
# uses: actions/setup-node@v4
226-
# with:
227-
# node-version: '18.x'
228-
# cache: 'npm'
229-
# cache-dependency-path: '**/package-lock.json'
230-
# - name: setup pnpm/yarn
231-
# run: corepack enable
232-
# shell: bash
233-
# - name: Install Deno
234-
# uses: denoland/setup-deno@v1
235-
# with:
236-
# # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
237-
# deno-version: v2.2.4
238-
# - name: 'Install dependencies'
239-
# run: npm ci
240-
# - name: 'Build'
241-
# run: npm run build
242-
# - name: 'Prepare Netlify CLI'
243-
# env:
244-
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
245-
# run: |
246-
# # Control netlify-cli as a regular dev dep but expose it globally for test fixtures to use
247-
# npm install -g "netlify-cli@$(npm list --json --depth=0 netlify-cli | jq -r ".dependencies[\"netlify-cli\"].version")"
248-
# npx netlify login
249-
# - name: Resolve Next.js version
250-
# id: resolve-next-version
251-
# shell: bash
252-
# run: |
253-
# RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
254-
# echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
255-
# echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
256-
# - name: 'Smoke tests'
257-
# run: npm run test:ci:smoke
258-
# env:
259-
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
260-
# NEXT_VERSION: ${{ matrix.version }}
261-
# NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
227+
smoke:
228+
if: always()
229+
needs: setup
230+
runs-on: ubuntu-latest
231+
strategy:
232+
fail-fast: false
233+
matrix:
234+
version: ${{ fromJson(needs.setup.outputs.matrix) }}
235+
steps:
236+
- uses: actions/checkout@v5
237+
- name: Decide Node Version
238+
id: decide-node-version
239+
shell: bash
240+
run: |
241+
NODE_VERSION=18.x
242+
if [ "${{ matrix.version}}" = "canary" ]; then
243+
# this is not ideal, because we set node@20 just when explicitly using canary tag as target
244+
# but next@canary are still on 15 major, so we can't yet use major version of resolved next version
245+
# as condition
246+
NODE_VERSION=20.x
247+
fi
248+
echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
249+
echo "Node version for 'next@${{ matrix.version }}' is '$NODE_VERSION'"
250+
- name: 'Install Node'
251+
uses: actions/setup-node@v4
252+
with:
253+
node-version: ${{ steps.decide-node-version.outputs.version }}
254+
cache: 'npm'
255+
cache-dependency-path: '**/package-lock.json'
256+
- name: setup pnpm/yarn
257+
run: corepack enable
258+
shell: bash
259+
- name: Install Deno
260+
uses: denoland/setup-deno@v1
261+
with:
262+
# Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
263+
deno-version: v2.2.4
264+
- name: 'Install dependencies'
265+
run: npm ci
266+
- name: 'Build'
267+
run: npm run build
268+
- name: 'Prepare Netlify CLI'
269+
env:
270+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
271+
run: |
272+
# Control netlify-cli as a regular dev dep but expose it globally for test fixtures to use
273+
npm install -g "netlify-cli@$(npm list --json --depth=0 netlify-cli | jq -r ".dependencies[\"netlify-cli\"].version")"
274+
npx netlify login
275+
- name: Resolve Next.js version
276+
id: resolve-next-version
277+
shell: bash
278+
run: |
279+
RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
280+
echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
281+
echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
282+
- name: 'Smoke tests'
283+
run: npm run test:ci:smoke
284+
env:
285+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
286+
NEXT_VERSION: ${{ matrix.version }}
287+
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
262288

263-
# merge-reports:
264-
# if: always()
265-
# needs: [setup,e2e]
266-
# strategy:
267-
# fail-fast: false
268-
# matrix:
269-
# version: ${{ fromJson(needs.setup.outputs.matrix) }}
289+
merge-reports:
290+
if: always()
291+
needs: [setup,e2e]
292+
strategy:
293+
fail-fast: false
294+
matrix:
295+
version: ${{ fromJson(needs.setup.outputs.matrix) }}
270296

271-
# runs-on: ubuntu-latest
272-
# steps:
273-
# - uses: actions/checkout@v5
274-
# - uses: actions/setup-node@v4
275-
# with:
276-
# node-version: 18
277-
# - name: Install dependencies
278-
# run: npm ci
297+
runs-on: ubuntu-latest
298+
steps:
299+
- uses: actions/checkout@v5
300+
- uses: actions/setup-node@v4
301+
with:
302+
node-version: 18
303+
- name: Install dependencies
304+
run: npm ci
279305

280-
# - name: Download blob reports from GitHub Actions Artifacts
281-
# uses: actions/download-artifact@v5
282-
# with:
283-
# path: all-blob-reports
284-
# pattern: blob-report-${{ matrix.version }}-*
285-
# merge-multiple: true
306+
- name: Download blob reports from GitHub Actions Artifacts
307+
uses: actions/download-artifact@v5
308+
with:
309+
path: all-blob-reports
310+
pattern: blob-report-${{ matrix.version }}-*
311+
merge-multiple: true
286312

287-
# - name: Merge reports
288-
# run: |
289-
# npx playwright merge-reports --reporter html ./all-blob-reports
290-
# npx playwright merge-reports --reporter json ./all-blob-reports > merged_reports.json
313+
- name: Merge reports
314+
run: |
315+
npx playwright merge-reports --reporter html ./all-blob-reports
316+
npx playwright merge-reports --reporter json ./all-blob-reports > merged_reports.json
291317
292-
# - name: Upload HTML report
293-
# uses: actions/upload-artifact@v4
294-
# with:
295-
# name: html-report-${{ matrix.version }}-attempt-${{ github.run_attempt }}
296-
# path: playwright-report
297-
# retention-days: 14
318+
- name: Upload HTML report
319+
uses: actions/upload-artifact@v4
320+
with:
321+
name: html-report-${{ matrix.version }}-attempt-${{ github.run_attempt }}
322+
path: playwright-report
323+
retention-days: 14

.github/workflows/test-e2e.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ concurrency:
1919
cancel-in-progress: true
2020

2121
env:
22-
NODE_VERSION: 20.9.0
2322
PNPM_VERSION: 8.9.0
2423
NEXT_REPO: vercel/next.js
2524
NEXT_TEST_MODE: deploy
@@ -106,6 +105,19 @@ jobs:
106105
path: ${{ env.next-path }}
107106
ref: ${{ matrix.version_spec.tag }}
108107

108+
- name: Decide Node Version
109+
id: decide-node-version
110+
shell: bash
111+
run: |
112+
NODE_VERSION=18.x
113+
if [ "${{ matrix.version_spec.selector }}" = "canary" ]; then
114+
# this is not ideal, because we set node@20 just when explicitly using canary tag as target
115+
# but next@canary are still on 15 major, so we can't yet use major version of resolved next version
116+
# as condition
117+
NODE_VERSION=20.x
118+
fi
119+
echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
120+
echo "Node version for 'next@${{ matrix.version_spec.selector }}' is '$NODE_VERSION'"
109121
- name: checkout runtime repo
110122
uses: actions/checkout@v5
111123
with:

0 commit comments

Comments
 (0)