Skip to content
Closed

Wat #2882

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 4 additions & 157 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,89 +36,18 @@ jobs:
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "matrix=${{ github.event.inputs.versions }}" >> $GITHUB_OUTPUT
elif [ "${{ github.event_name }}" = "schedule" ] || [ "${{ steps.check-labels.outputs.result }}" = "true" ]; then
echo "matrix=[\"latest\", \"canary\", \"14.2.15\", \"13.5.1\"]" >> $GITHUB_OUTPUT
echo "matrix=[\"latest\", \"canary\"]" >> $GITHUB_OUTPUT
else
echo "matrix=[\"latest\"]" >> $GITHUB_OUTPUT
fi

e2e:
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.setup.outputs.matrix) }}
shard: [1, 2, 3, 4, 5]

steps:
- uses: actions/checkout@v4
- name: 'Install Node'
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- uses: oven-sh/setup-bun@v1
- name: setup pnpm/yarn
run: |
npm install -g corepack
corepack enable
shell: bash
- name: Install Deno
uses: denoland/setup-deno@v1
with:
# Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
deno-version: v1.44.4
- name: 'Install dependencies'
run: npm ci
- name: 'Prepare Netlify CLI'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
# Control netlify-cli as a regular dev dep but expose it globally for test fixtures to use
npm install -g "netlify-cli@$(npm list --json --depth=0 netlify-cli | jq -r ".dependencies[\"netlify-cli\"].version")"
npx netlify login
- name: Get installed Playwright version
id: playwright-version
run: echo "version=$(npm view @playwright/test version)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: playwright-cache
with:
path: '~/.cache/ms-playwright'
key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}'
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Resolve Next.js version
id: resolve-next-version
shell: bash
run: |
RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
- name: Run Playwright tests
run: npm run test:ci:e2e -- --shard=${{ matrix.shard }}/5
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NEXT_VERSION: ${{ matrix.version }}
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
- name: Upload blob report to GitHub Actions Artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: blob-report-${{matrix.version}}-${{ matrix.shard }}
path: blob-report
retention-days: 1

test:
needs: setup
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8]
shard: [6]
os: [ubuntu-latest, windows-latest]
version: ${{ fromJson(needs.setup.outputs.matrix) }}
steps:
Expand Down Expand Up @@ -151,6 +80,8 @@ jobs:
run: npm ci
- name: 'Build'
run: npm run build
- name: 'Vendor deno helpers for integration tests'
run: node tools/vendor-deno-tools.js
- name: Resolve Next.js version
id: resolve-next-version
shell: bash
Expand Down Expand Up @@ -188,87 +119,3 @@ jobs:
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
TEMP: ${{ github.workspace }}/..

smoke:
if: always()
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.setup.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- name: 'Install Node'
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: setup pnpm/yarn
run: corepack enable
shell: bash
- name: Install Deno
uses: denoland/setup-deno@v1
with:
# Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20
deno-version: v1.44.4
- name: 'Install dependencies'
run: npm ci
- name: 'Build'
run: npm run build
- name: 'Prepare Netlify CLI'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
# Control netlify-cli as a regular dev dep but expose it globally for test fixtures to use
npm install -g "netlify-cli@$(npm list --json --depth=0 netlify-cli | jq -r ".dependencies[\"netlify-cli\"].version")"
npx netlify login
- name: Resolve Next.js version
id: resolve-next-version
shell: bash
run: |
RESOLVED_VERSION=$(npm view next@${{ matrix.version }} version)
echo "version=$RESOLVED_VERSION" >> $GITHUB_OUTPUT
echo "Resolved Next.js version for 'next@${{ matrix.version }}' is '$RESOLVED_VERSION'"
- name: 'Smoke tests'
run: npm run test:ci:smoke
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NEXT_VERSION: ${{ matrix.version }}
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}

merge-reports:
if: always()
needs: [setup,e2e]
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.setup.outputs.matrix) }}

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Install dependencies
run: npm ci

- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v4
with:
path: all-blob-reports
pattern: blob-report-${{ matrix.version }}-*
merge-multiple: true

- name: Merge reports
run: |
npx playwright merge-reports --reporter html ./all-blob-reports
npx playwright merge-reports --reporter json ./all-blob-reports > merged_reports.json

- name: Upload HTML report
uses: actions/upload-artifact@v4
with:
name: html-report-${{ matrix.version }}-attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ node_modules/
dist/
.next
edge-runtime/vendor
# deno.json is ephemeral and generated for the purpose of vendoring remote modules in CI
tools/deno/deno.json
tools/deno/vendor

# Local Netlify folder
.netlify
Expand Down
Loading
Loading