Some checks failed
Test examples / Test Examples (20) (push) Has been cancelled
Test examples / Test Examples (22) (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Trigger Release / start (push) Has been cancelled
Stale issue handler / stale (push) Has been cancelled
Update Font Data / create-pull-request (push) Has been cancelled
build-and-deploy / deploy-target (push) Has been cancelled
build-and-deploy / build (push) Has been cancelled
build-and-deploy / stable - aarch64-unknown-linux-musl - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-unknown-linux-musl - node@16 (push) Has been cancelled
build-and-deploy / stable - aarch64-unknown-linux-gnu - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-unknown-linux-gnu - node@16 (push) Has been cancelled
build-and-deploy / stable - aarch64-pc-windows-msvc - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-pc-windows-msvc - node@16 (push) Has been cancelled
build-and-deploy / stable - aarch64-apple-darwin - node@16 (push) Has been cancelled
build-and-deploy / stable - x86_64-apple-darwin - node@16 (push) Has been cancelled
build-and-deploy / build-wasm (nodejs) (push) Has been cancelled
build-and-deploy / build-wasm (web) (push) Has been cancelled
build-and-deploy / Deploy preview tarball (push) Has been cancelled
build-and-deploy / Potentially publish release (push) Has been cancelled
build-and-deploy / publish-turbopack-npm-packages (push) Has been cancelled
build-and-deploy / Deploy examples (push) Has been cancelled
build-and-deploy / thank you, build (push) Has been cancelled
build-and-deploy / Upload Turbopack Bytesize metrics to Datadog (push) Has been cancelled
Rspack Next.js development integration tests / Rspack integration tests (push) Has been cancelled
Rspack Next.js production integration tests / Rspack integration tests (push) Has been cancelled
Turbopack Next.js development integration tests / Next.js integration tests (push) Has been cancelled
Turbopack Next.js production integration tests / Next.js integration tests (push) Has been cancelled
Update Rspack test manifest / Update and upload Rspack development test manifest (push) Has been cancelled
Update Rspack test manifest / Update and upload Rspack production test manifest (push) Has been cancelled
Upload bundler test manifests to areweturboyet.com / Upload test results (push) Has been cancelled
Update React / create-pull-request (push) Has been cancelled
test-e2e-project-reset-cron / reset-test-project (push) Has been cancelled
Notify about the top 15 issues/PRs/feature requests (most reacted) in the last 90 days / run (push) Has been cancelled
126 lines
4.8 KiB
YAML
126 lines
4.8 KiB
YAML
# Reusable workflow to setup next.js integration test environment.
|
|
name: Setup Next.js
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
# Allow to specify Next.js version to run integration test against.
|
|
# If not specified, will use latest release version including canary.
|
|
version:
|
|
type: string
|
|
nodeVersion:
|
|
required: false
|
|
description: 'version of Node.js to use'
|
|
type: string
|
|
|
|
jobs:
|
|
build_nextjs:
|
|
name: Build Next.js for the turbopack integration test
|
|
runs-on:
|
|
- 'self-hosted'
|
|
- 'linux'
|
|
- 'x64'
|
|
- 'metal'
|
|
outputs:
|
|
output1: ${{ steps.build-next-swc-turbopack-patch.outputs.success }}
|
|
steps:
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ inputs.nodeVersion || env.NODE_LTS_VERSION }}
|
|
check-latest: true
|
|
- name: Get number of CPU cores
|
|
uses: SimenB/github-actions-cpu-cores@v2
|
|
id: cpu-cores
|
|
|
|
- name: 'Setup Rust toolchain'
|
|
uses: dtolnay/rust-toolchain@stable
|
|
|
|
- name: Display runner information
|
|
run: echo runner cpu count ${{ steps.cpu-cores.outputs.count }}
|
|
|
|
- name: Find Next.js latest release version
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
run: |
|
|
# Grab the latest release version from next.js repo, including prelease. `/releases/latest` will only return latest stable release.
|
|
echo NEXJS_LATEST_VERSION=$(gh release --repo vercel/next.js --limit 1 list | sed -n 1p | awk '{print $1}') >> $GITHUB_ENV
|
|
|
|
- name: Set Next.js release version
|
|
run: |
|
|
echo "NEXTJS_VERSION=${{ inputs.version != '' && inputs.version || env.NEXJS_LATEST_VERSION }}" >> $GITHUB_ENV
|
|
|
|
- name: Print Next.js release version to checkout
|
|
run: echo "Checking out Next.js ${{ env.NEXTJS_VERSION }}"
|
|
|
|
- name: Checkout Next.js
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: vercel/next.js
|
|
ref: ${{ env.NEXTJS_VERSION }}
|
|
|
|
- name: Checkout failed test lists
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: vercel/turbo
|
|
ref: nextjs-integration-test-data
|
|
path: integration-test-data
|
|
|
|
- name: Download binary
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts
|
|
|
|
- uses: actions/cache/restore@v3
|
|
id: restore-build
|
|
with:
|
|
path: |
|
|
./*
|
|
key: ${{ inputs.version }}-${{ github.sha }}
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
wget https://github.com/sharkdp/hyperfine/releases/download/v1.16.1/hyperfine_1.16.1_amd64.deb
|
|
sudo dpkg -i hyperfine_1.16.1_amd64.deb
|
|
npm i -g corepack@0.31
|
|
corepack enable
|
|
pnpm install --loglevel error
|
|
|
|
- name: Build next-swc
|
|
run: |
|
|
hyperfine --min-runs 1 --show-output 'pnpm run --filter=@next/swc build-native --features plugin --release'
|
|
echo "Successfully built next-swc with published turbopack"
|
|
|
|
- name: Build next.js
|
|
run: |
|
|
pnpm run build
|
|
strip packages/next-swc/native/next-swc.*.node
|
|
ls -al packages/next-swc/native
|
|
# Reduce the size of the cache bit
|
|
cd packages/next-swc && cargo clean && cd ../../
|
|
echo NEXT_SWC_FILESIZE: $(stat -c %s packages/next-swc/native/next-swc.linux-x64-gnu.node)
|
|
node -e "console.log('Host', require('os').arch(), require('os').platform())"
|
|
|
|
# If input version is published release, detect version by running next.js build.
|
|
- name: Detects Next.js build version
|
|
run: |
|
|
# This is being used in github action to collect test results. Do not change it, or should update ./.github/actions/next-integration-test to match.
|
|
docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c 'curl https://install-node.vercel.app/v16 | FORCE=1 bash && cd /work && echo RUNNING NEXTJS VERSION: $(packages/next/dist/bin/next --version) && ls -al packages/next-swc/native && node -e "console.log(\"Container\", require(\"os\").arch(), require(\"os\").platform())"'
|
|
|
|
- name: Temporary test skip
|
|
run: |
|
|
rm -rf test/integration/jsconfig-paths/test/index.test.js
|
|
|
|
# Once build completes, creates a cache of the build output
|
|
# so subsequent job to actually execute tests can reuse it.
|
|
# Note that we do not use upload / download artifacts for this -
|
|
# it is too heavyweight for the purpose since we do not need to persist
|
|
# the cache across multiple runs.
|
|
- name: Store next.js build cache with next-swc
|
|
uses: actions/cache/save@v3
|
|
id: cache-build
|
|
with:
|
|
path: |
|
|
./*
|
|
key: ${{ inputs.version }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt}}-${{ github.run_number }}
|