Skip to content
Open
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
4 changes: 4 additions & 0 deletions .changeset/next-hmr-e2e.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

Exercise Next.js HMR convergence against stable and canary releases.
25 changes: 25 additions & 0 deletions .github/actions/setup-next-canary/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Setup Next.js Canary'
description: 'Install a Next.js canary and rebuild the workspace packages.'

inputs:
app-name:
description: 'Workbench app name'
required: true
next-version:
description: 'Next.js canary version'
required: true

runs:
using: 'composite'
steps:
- shell: bash
env:
APP_NAME: ${{ inputs.app-name }}
NEXT_VERSION: ${{ inputs.next-version }}
run: |
jq --arg version "$NEXT_VERSION" '.devDependencies.next=$version' packages/next/package.json > packages/next/package.json.new
mv packages/next/package.json.new packages/next/package.json
jq --arg version "$NEXT_VERSION" '.dependencies.next=$version' "workbench/$APP_NAME/package.json" > "workbench/$APP_NAME/package.json.new"
mv "workbench/$APP_NAME/package.json.new" "workbench/$APP_NAME/package.json"
pnpm install --no-frozen-lockfile
pnpm turbo run build --filter='!./workbench/*'
45 changes: 15 additions & 30 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
NEXT_CANARY_VERSION: 16.4.0-canary.10

jobs:
ci-scope:
name: Detect CI Scope
Expand Down Expand Up @@ -1099,12 +1102,10 @@ jobs:

- name: Setup canary
if: ${{ matrix.app.canary }}
env:
APP_NAME: ${{ matrix.app.name }}
run: |
cat packages/next/package.json | jq '.dependencies.next|="16.3.1-canary.17"' > packages/next/package.json.new && mv packages/next/package.json.new packages/next/package.json
cat "workbench/$APP_NAME/package.json" | jq '.dependencies.next|="16.3.1-canary.17"' > "workbench/$APP_NAME/package.json.new" && mv "workbench/$APP_NAME/package.json.new" "workbench/$APP_NAME/package.json"
pnpm install --no-frozen-lockfile
uses: ./.github/actions/setup-next-canary
with:
app-name: ${{ matrix.app.name }}
next-version: ${{ env.NEXT_CANARY_VERSION }}

- name: Download shared package builds
if: ${{ !matrix.app.canary }}
Expand All @@ -1113,10 +1114,6 @@ jobs:
name: e2e-package-build-artifacts
path: packages

- name: Run Initial Build for Next.js canary
if: ${{ matrix.app.canary }}
run: pnpm turbo run build --filter='!./workbench/*'

- name: Prepare workbench path
id: prepare-workbench
uses: ./.github/actions/prepare-workbench-path
Expand Down Expand Up @@ -1186,12 +1183,10 @@ jobs:

- name: Setup canary
if: ${{ matrix.app.canary }}
env:
APP_NAME: ${{ matrix.app.name }}
run: |
cat packages/next/package.json | jq '.dependencies.next|="16.3.1-canary.17"' > packages/next/package.json.new && mv packages/next/package.json.new packages/next/package.json
cat "workbench/$APP_NAME/package.json" | jq '.dependencies.next|="16.3.1-canary.17"' > "workbench/$APP_NAME/package.json.new" && mv "workbench/$APP_NAME/package.json.new" "workbench/$APP_NAME/package.json"
pnpm install --no-frozen-lockfile
uses: ./.github/actions/setup-next-canary
with:
app-name: ${{ matrix.app.name }}
next-version: ${{ env.NEXT_CANARY_VERSION }}

- name: Download shared package builds
if: ${{ !matrix.app.canary }}
Expand All @@ -1200,10 +1195,6 @@ jobs:
name: e2e-package-build-artifacts
path: packages

- name: Run Initial Build for Next.js canary
if: ${{ matrix.app.canary }}
run: pnpm turbo run build --filter='!./workbench/*'

- name: Prepare workbench path
id: prepare-workbench
uses: ./.github/actions/prepare-workbench-path
Expand Down Expand Up @@ -1302,12 +1293,10 @@ jobs:

- name: Setup canary
if: ${{ matrix.app.canary }}
env:
APP_NAME: ${{ matrix.app.name }}
run: |
cat packages/next/package.json | jq '.dependencies.next|="16.3.1-canary.17"' > packages/next/package.json.new && mv packages/next/package.json.new packages/next/package.json
cat "workbench/$APP_NAME/package.json" | jq '.dependencies.next|="16.3.1-canary.17"' > "workbench/$APP_NAME/package.json.new" && mv "workbench/$APP_NAME/package.json.new" "workbench/$APP_NAME/package.json"
pnpm install --no-frozen-lockfile
uses: ./.github/actions/setup-next-canary
with:
app-name: ${{ matrix.app.name }}
next-version: ${{ env.NEXT_CANARY_VERSION }}

- name: Download shared package builds
if: ${{ !matrix.app.canary }}
Expand All @@ -1316,10 +1305,6 @@ jobs:
name: e2e-package-build-artifacts
path: packages

- name: Run Initial Build for Next.js canary
if: ${{ matrix.app.canary }}
run: pnpm turbo run build --filter='!./workbench/*'

- name: Setup PostgreSQL Database
run: ./packages/world-postgres/bin/setup.js

Expand Down
Loading
Loading