Skip to content

chore(deps): update dependency @netlify/build to ^35.5.6 #3381

chore(deps): update dependency @netlify/build to ^35.5.6

chore(deps): update dependency @netlify/build to ^35.5.6 #3381

Workflow file for this run

name: "Run tests"
on:
pull_request:
branches: [main]
schedule:
- cron: "0 6 * * *" # Run every day at 6am UTC
workflow_dispatch:
inputs:
versions:
description: "The versions of Next.js to test against (quoted and comma separated)"
required: false
default: "latest"
runOnWindows:
description: "Run tests on Windows"
type: boolean
jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
os: ${{ steps.set-matrix.outputs.os }}
steps:
- name: Check PR labels
if: github.event_name == 'pull_request'
id: check-labels
uses: actions/github-script@v8
with:
script: |
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
});
const runOnWindows = labels.some(label => label.name === 'test on windows');
let versionsToTest = 'latest';
if (labels.some(label => label.name === 'autorelease: pending' || label.name === 'test all versions')) {
versionsToTest = 'all';
} else if (labels.some(label => label.name === 'test latest and canary')) {
versionsToTest = 'latest-and-canary';
}
return {
versionsToTest,
runOnWindows
}
- name: Set Next.js versions to test
id: set-matrix
uses: actions/github-script@v8
with:
script: |
// steps.check-labels.outputs.result will be not defined on non-PR events, so we create
// either a JSON string or an empty string first and later will check if string is empty
// and either parse JSON string or use a default empty object
const checkLabelsResult = '${{ steps.check-labels.outputs.result }}';
let { versionsToTest, runOnWindows } = checkLabelsResult ? JSON.parse(checkLabelsResult) : {}
if ('${{ github.event_name }}' === 'workflow_dispatch') {
// attempt some massaging of input to cover potential variants of inputs
// - `["latest", "canary"]`
// - `latest, canary`
// - `"latest", "canary"`
// - `'latest','canary'`
// Will strip `[]'"` and whitespaces first, then split by comma
const normalizedVersionsInputArray = `${{ github.event.inputs.versions }}`
.replaceAll(/["'\[\]\s]+/g, "")
.split(',')
core.setOutput('matrix', JSON.stringify(normalizedVersionsInputArray));
} else if ('${{ github.event_name }}' === 'schedule' || versionsToTest === 'all') {
core.setOutput('matrix', '["latest", "canary", "15.5.9", "14.2.35", "13.5.1"]');
} else if (versionsToTest === 'latest-and-canary') {
core.setOutput('matrix', '["latest", "canary"]');
} else {
core.setOutput('matrix', '["latest"]');
}
if ('${{ github.event_name }}' === 'workflow_dispatch' && "${{ github.event.inputs.runOnWindows }}" == "true") {
runOnWindows = true
}
if (runOnWindows) {
core.setOutput('os', '["ubuntu-latest", "windows-2025"]');
} else {
core.setOutput('os', '["ubuntu-latest"]');
}
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@v6
- 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: Decide Node Version
id: decide-node-version
shell: bash
run: |
NODE_VERSION=18.x
if [[ "${{ steps.resolve-next-version.outputs.version }}" == "16."* ]]; then
# Next@16 requires Node.js 20+
NODE_VERSION=20.x
fi
echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
echo "Node version for 'next@${{ steps.resolve-next-version.outputs.version }}' is '$NODE_VERSION'"
- name: "Install Node"
uses: actions/setup-node@v6
with:
node-version: ${{ steps.decide-node-version.outputs.version }}
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- uses: oven-sh/setup-bun@v2
- 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: 2.5.6
- 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@v5
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: 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 }}
NODE_OPTIONS: --import file://${{ github.workspace }}/tools/fetch-retry.mjs
- name: Upload blob report to GitHub Actions Artifacts
uses: actions/upload-artifact@v6
if: always()
with:
name: blob-report-${{matrix.version}}-${{ matrix.shard }}
path: blob-report
retention-days: 1
test:
needs: setup
strategy:
fail-fast: false
matrix:
shard: [1, 2, 3, 4, 5, 6, 7, 8]
os: ${{ fromJson(needs.setup.outputs.os) }}
version: ${{ fromJson(needs.setup.outputs.matrix) }}
exclude:
- os: windows-2025
version: "13.5.1"
- os: windows-2025
version: "14.2.35"
- os: windows-2025
version: "15.5.9"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- 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: Decide Node Version
id: decide-node-version
shell: bash
run: |
NODE_VERSION=18.x
if [[ "${{ steps.resolve-next-version.outputs.version }}" == "16."* ]]; then
# Next@16 requires Node.js 20+
NODE_VERSION=20.x
fi
echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
echo "Node version for 'next@${{ matrix.version }}' is '$NODE_VERSION'"
- name: "Install Node"
uses: actions/setup-node@v6
with:
node-version: ${{ steps.decide-node-version.outputs.version }}
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/edge-bundler/blob/e55f825bd985d3c92e21d1b765d71e70d5628fba/node/bridge.ts#L17
deno-version: 2.5.6
- name: "Install dependencies"
run: npm ci
- name: "Build"
run: npm run build
- name: "Vendor deno helpers for integration tests"
run: node tools/vendor-deno-tools.js
- name: Compute Fixtures Cache Key
id: fixture-cache-key
# Fixtures only need to be rebuilt if either fixture or support files change,
# so we're using a hash of the fixtures and support files as the cache key.
run:
echo "key=$(git ls-files -s tests/fixtures/ tests/utils/ tests/prepare.mjs | git hash-object --stdin)"
>> "$GITHUB_OUTPUT"
shell: bash
- name: Cache Fixtures
id: cache-fixtures
uses: actions/cache@v5
with:
path: tests/fixtures
key:
integration-fixtures-${{ runner.os }}-${{steps.resolve-next-version.outputs.version}}-${{
steps.fixture-cache-key.outputs.key }}
- name: "Prepare Fixtures"
if: steps.cache-fixtures.outputs.cache-hit != 'true'
run: npm run pretest
env:
NEXT_VERSION: ${{ matrix.version }}
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
NODE_OPTIONS: --import file://${{ github.workspace }}/tools/fetch-retry.mjs
- name: "Unit and integration tests"
run: npm run test:ci:unit-and-integration -- --shard=${{ matrix.shard }}/8
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NEXT_VERSION: ${{ matrix.version }}
NEXT_RESOLVED_VERSION: ${{ steps.resolve-next-version.outputs.version }}
TEMP: ${{ github.workspace }}/..
NODE_OPTIONS: --import file://${{ github.workspace }}/tools/fetch-retry.mjs
smoke:
if: always()
needs: setup
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.setup.outputs.matrix) }}
steps:
- uses: actions/checkout@v6
- 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: Decide Node Version
id: decide-node-version
shell: bash
run: |
NODE_VERSION=18.x
if [[ "${{ steps.resolve-next-version.outputs.version }}" == "16."* ]]; then
# Next@16 requires Node.js 20+
NODE_VERSION=20.x
fi
echo "version=$NODE_VERSION" >> $GITHUB_OUTPUT
echo "Node version for 'next@${{ matrix.version }}' is '$NODE_VERSION'"
- name: "Install Node"
uses: actions/setup-node@v6
with:
node-version: ${{ steps.decide-node-version.outputs.version }}
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: 2.5.6
- 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: "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 }}
NODE_OPTIONS: --import file://${{ github.workspace }}/tools/fetch-retry.mjs
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@v6
- uses: actions/setup-node@v6
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@v7
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@v6
with:
name: html-report-${{ matrix.version }}-attempt-${{ github.run_attempt }}
path: playwright-report
retention-days: 14