Skip to content

Pick esm main fields and condition names first for RSC server layer #54756

Pick esm main fields and condition names first for RSC server layer

Pick esm main fields and condition names first for RSC server layer #54756

on:
push:
branches: ['canary', 'trunk-merge/*']
pull_request:
types: [opened, synchronize]
merge_group:
name: Build, test, and deploy
env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 1.6.3
RUST_TOOLCHAIN: nightly-2023-03-09
PNPM_VERSION: 7.24.3
NODE_MAINTENANCE_VERSION: 16
NODE_LTS_VERSION: 18
jobs:
check-examples:
name: Check examples
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install moreutils
run: sudo apt install moreutils
- name: Check examples
run: ./scripts/check-examples.sh
build:
runs-on: ubuntu-latest
env:
NEXT_TELEMETRY_DISABLED: 1
# we build a dev binary for use in CI so skip downloading
# canary next-swc binaries in the monorepo
NEXT_SKIP_NATIVE_POSTINSTALL: 1
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
outputs:
docsChange: ${{ steps.docs-change.outputs.DOCS_CHANGE }}
codemodChange: ${{ steps.codemod-change.outputs.CODEMOD_CHANGE }}
isRelease: ${{ steps.check-release.outputs.IS_RELEASE }}
swcChange: ${{ steps.swc-change.outputs.SWC_CHANGE }}
turboToken: ${{ steps.turbo-token.outputs.TURBO_TOKEN }}
weekNum: ${{ steps.get-week.outputs.WEEK }}
steps:
- name: Setup node
uses: actions/setup-node@v3
if: ${{ steps.docs-change.outputs.docsChange == 'nope' }}
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- uses: actions/checkout@v3
with:
fetch-depth: 25
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- name: Check non-docs only change
run: echo "DOCS_CHANGE<<EOF" >> $GITHUB_OUTPUT; echo "$(node scripts/run-for-change.js --not --type docs --exec echo 'nope')" >> $GITHUB_OUTPUT; echo 'EOF' >> $GITHUB_OUTPUT
id: docs-change
- run: echo "${{steps.docs-change.outputs.DOCS_CHANGE}}"
- name: Check codemod change
run: echo "CODEMOD_CHANGE<<EOF" >> $GITHUB_OUTPUT; echo "$(node scripts/run-for-change.js --type next-codemod --exec echo 'yup')" >> $GITHUB_OUTPUT; echo 'EOF' >> $GITHUB_OUTPUT
id: codemod-change
- run: echo "${{steps.codemod-change.outputs.CODEMOD_CHANGE}}"
- run: echo "SWC_CHANGE<<EOF" >> $GITHUB_OUTPUT; echo "$(node scripts/run-for-change.js --type next-swc --exec echo 'yup')" >> $GITHUB_OUTPUT; echo 'EOF' >> $GITHUB_OUTPUT
id: swc-change
- run: echo "TURBO_TOKEN=$(echo ${TURBO_TOKEN:-empty})" >> $GITHUB_OUTPUT
id: turbo-token
- run: echo "${{steps.swc-change.outputs.SWC_CHANGE}}"
- run: npm i -g pnpm@${PNPM_VERSION}
- id: get-store-path
run: echo STORE_PATH=$(pnpm store path) >> $GITHUB_OUTPUT
- uses: actions/cache@v3
timeout-minutes: 5
id: cache-pnpm-store
with:
path: ${{ steps.get-store-path.outputs.STORE_PATH }}
key: pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
pnpm-store-
pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
- run: pnpm install
- run: TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} node run-tests.js --timings --write-timings -g 1/1
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
- run: pnpm run build
- id: check-release
run: |
if [[ $(node ./scripts/check-is-release.js 2> /dev/null || :) = v* ]];
then
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT
else
echo "IS_RELEASE=false" >> $GITHUB_OUTPUT
fi
# We use week in the turbo cache key to keep the cache from infinitely growing
- id: get-week
run: echo "WEEK=$(date +%U)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
timeout-minutes: 5
id: cache-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
lint:
runs-on: ubuntu-latest
needs: build
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- run: npm i -g pnpm@${PNPM_VERSION}
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- run: ./scripts/check-manifests.js
- run: pnpm lint
if: ${{needs.build.outputs.docsChange == 'nope'}}
- run: pnpm lint-no-typescript
if: ${{needs.build.outputs.docsChange != 'nope'}}
rust-check:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- run: echo "SWC_CHANGE<<EOF" >> $GITHUB_OUTPUT; echo "$(node scripts/run-for-change.js --type next-swc --exec echo 'yup')" >> $GITHUB_OUTPUT; echo 'EOF' >> $GITHUB_OUTPUT
id: swc-change
- run: echo "${{ steps.swc-change.outputs.SWC_CHANGE }}"
- name: Install
uses: actions-rs/toolchain@v1
if: ${{ steps.swc-change.outputs.SWC_CHANGE == 'yup' }}
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: rustfmt, clippy
- name: Cache cargo registry
uses: actions/cache@v3
timeout-minutes: 5
if: ${{ steps.swc-change.outputs.SWC_CHANGE == 'yup' }}
with:
path: ~/.cargo/registry
key: stable-ubuntu-clippy-cargo-registry
- name: Cache cargo index
uses: actions/cache@v3
timeout-minutes: 5
if: ${{ steps.swc-change.outputs.SWC_CHANGE == 'yup' }}
with:
path: ~/.cargo/git
key: stable-ubuntu-clippy-cargo-index
- name: Check
if: ${{ steps.swc-change.outputs.SWC_CHANGE == 'yup' }}
run: |
cargo fmt -- --check
cargo clippy --all -- -D warnings -A deprecated
cargo check -p next-dev --no-default-features --features cli,custom_allocator,rustls-tls,__internal_nextjs_integration_test
checkPrecompiled:
name: Check Pre-compiled
runs-on: ubuntu-latest
needs: build
env:
NEXT_TELEMETRY_DISABLED: 1
steps:
- name: Setup node
uses: actions/setup-node@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/checkout@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
- run: mv .git .git-bak
if: ${{needs.build.outputs.docsChange == 'nope'}}
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- run: npm i -g pnpm@${PNPM_VERSION}
- run: rm -rf .git && mv .git-bak .git
if: ${{needs.build.outputs.docsChange == 'nope'}}
- run: ./scripts/check-pre-compiled.sh
if: ${{needs.build.outputs.docsChange == 'nope'}}
- uses: EndBug/add-and-commit@v7
if: ${{ failure() }}
with:
add: 'packages/next/compiled packages/next/bundles --force'
message: '⚙ Update compiled files'
testUnit:
name: Test Unit
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 10
env:
NEXT_TELEMETRY_DISABLED: 1
steps:
- name: Setup node
uses: actions/setup-node@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange == 'nope'}}
- run: node run-tests.js --type unit
if: ${{needs.build.outputs.docsChange == 'nope'}}
# run LTS matrix always and maintenance tests during a release
testDevLTS:
name: Test Development Node.js LTS
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
node: [18]
group: [1, 2, 3, 4, 5]
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=dev TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --type development --timings -g ${{ matrix.group }}/5 >> /proc/1/fd/1"
name: Run test/development
if: ${{needs.build.outputs.docsChange == 'nope'}}
- name: Upload test trace
if: always()
uses: actions/upload-artifact@v3
with:
name: test-trace
if-no-files-found: ignore
retention-days: 2
path: |
test/traces
testDevMaintenance:
name: Test Development Node.js Maintenance
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
node: [16]
group: [1, 2, 3, 4, 5]
# we can't use "matrix" context in job level "if" so we have
# to create a separate job which can skip
if: ${{ needs.build.outputs.isRelease == 'true' }}
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=dev TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --type development --timings -g ${{ matrix.group }}/5 >> /proc/1/fd/1"
name: Run test/development
if: ${{needs.build.outputs.docsChange == 'nope'}}
- name: Upload test trace
if: always()
uses: actions/upload-artifact@v3
with:
name: test-trace
if-no-files-found: ignore
retention-days: 2
path: |
test/traces
testDevE2ELTS:
name: Test Development (E2E) Node.js LTS
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
node: [18]
group: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=dev TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --type e2e --timings -g ${{ matrix.group }}/8 >> /proc/1/fd/1"
name: Run test/e2e (dev)
if: ${{needs.build.outputs.docsChange == 'nope'}}
- name: Upload test trace
if: always()
uses: actions/upload-artifact@v3
with:
name: test-trace
if-no-files-found: ignore
retention-days: 2
path: |
test/traces
testDevE2EMaintenance:
name: Test Development (E2E) Node.js Maintenance
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
node: [16]
group: [1, 2, 3, 4, 5, 6, 7, 8]
if: ${{ needs.build.outputs.isRelease == 'true' }}
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=dev TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --type e2e --timings -g ${{ matrix.group }}/8 >> /proc/1/fd/1"
name: Run test/e2e (dev)
if: ${{needs.build.outputs.docsChange == 'nope'}}
- name: Upload test trace
if: always()
uses: actions/upload-artifact@v3
with:
name: test-trace
if-no-files-found: ignore
retention-days: 2
path: |
test/traces
testProdLTS:
name: Test Production Node.js LTS
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 15
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
node: [18]
group: [1, 2, 3, 4, 5]
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=start TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --type production --timings -g ${{ matrix.group }}/5 >> /proc/1/fd/1"
name: Run test/production
if: ${{needs.build.outputs.docsChange == 'nope'}}
testProdMaintenance:
name: Test Production Node.js Maintenance
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 15
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
node: [16]
group: [1, 2, 3, 4, 5]
if: ${{ needs.build.outputs.isRelease == 'true' }}
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=start TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --type production --timings -g ${{ matrix.group }}/5 >> /proc/1/fd/1"
name: Run test/production
if: ${{needs.build.outputs.docsChange == 'nope'}}
testProdE2ELTS:
name: Test Production (E2E) Node.js LTS
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
node: [18]
group: [1, 2, 3, 4, 5, 6, 7, 8]
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=start TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --type e2e --timings -g ${{ matrix.group }}/8 >> /proc/1/fd/1"
name: Run test/e2e (production)
if: ${{needs.build.outputs.docsChange == 'nope'}}
testProdE2EMaintenance:
name: Test Production (E2E) Node.js Maintenance
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
node: [16]
group: [1, 2, 3, 4, 5, 6, 7, 8]
# run LTS matrix always and maintenance tests during a release
if: ${{ needs.build.outputs.isRelease == 'true' }}
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=start TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --type e2e --timings -g ${{ matrix.group }}/8 >> /proc/1/fd/1"
name: Run test/e2e (production)
if: ${{needs.build.outputs.docsChange == 'nope'}}
testCNA:
name: Test Create Next App
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{ needs.build.outputs.docsChange == 'nope' }}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{ needs.build.outputs.docsChange == 'nope' }}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_CNA=1 xvfb-run node run-tests.js test/integration/create-next-app/*.test.ts >> /proc/1/fd/1"
if: ${{ needs.build.outputs.docsChange == 'nope' }}
- name: Upload test trace
if: always()
uses: actions/upload-artifact@v3
with:
name: test-trace
if-no-files-found: ignore
retention-days: 2
path: |
test/traces
testCodemods:
name: Test Codemods
runs-on: ubuntu-latest
needs: [build]
timeout-minutes: 5
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
steps:
- run: echo "${{needs.build.outputs.codemodChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
if: ${{ needs.build.outputs.codemodChange == 'yup' }}
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
if: ${{ needs.build.outputs.codemodChange == 'yup' }}
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Run tests
if: ${{ needs.build.outputs.codemodChange == 'yup' }}
run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && npm i -g pnpm@${PNPM_VERSION} > /dev/null && cd ./packages/next-codemod && pnpm build && pnpm test >> /proc/1/fd/1"
testIntegration:
name: Test Integration
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
strategy:
fail-fast: false
matrix:
group:
[
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
]
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/28 >> /proc/1/fd/1"
if: ${{needs.build.outputs.docsChange == 'nope'}}
- name: Upload test trace
if: always()
uses: actions/upload-artifact@v3
with:
name: test-trace
if-no-files-found: ignore
retention-days: 2
path: |
test/traces
testElectron:
name: Test Electron
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 10
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_ELECTRON: 1
steps:
- name: Setup node
uses: actions/setup-node@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
node-version: ${{ env.NODE_MAINTENANCE_VERSION }}
check-latest: true
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: npm i -g pnpm@${PNPM_VERSION}
if: ${{needs.build.outputs.docsChange == 'nope'}}
- run: cd test/integration/with-electron/app && yarn install
if: ${{needs.build.outputs.docsChange == 'nope'}}
- run: xvfb-run node run-tests.js test/integration/with-electron/test/index.test.js
if: ${{needs.build.outputs.docsChange == 'nope'}}
# A job to run sets of devlopment tests with turbopack enabled.
testDevTurbopack:
name: Test Development (Turbopack)
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
# Enabling backtrace will makes snapshot tests fail
RUST_BACKTRACE: 0
# Path to the custom next-swc bindings.
NEXT_BINDINGS_BIN: /work/packages/next-swc/native/next-swc.linux-x64-gnu.node
# Glob pattern to run specific tests with --turbo.
NEXT_DEV_TEST_GLOB: '*'
NEXT_EXTERNAL_TESTS_FILTERS: /work/packages/next-swc/crates/next-dev-tests/tests-manifest.js
strategy:
fail-fast: false
matrix:
node: [18]
group: [1, 2, 3, 4, 5]
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && node -v && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_EXTERNAL_TESTS_FILTERS=${NEXT_EXTERNAL_TESTS_FILTERS} __INTERNAL_NEXT_DEV_TEST_TURBO_DEV=TRUE __INTERNAL_CUSTOM_TURBOPACK_BINDINGS=${NEXT_BINDINGS_BIN} __INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH=${NEXT_DEV_TEST_GLOB} NEXT_E2E_TEST_TIMEOUT=240000 NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=dev TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --type development --timings -g ${{ matrix.group }}/5 >> /proc/1/fd/1"
name: Run test/development
if: ${{needs.build.outputs.docsChange == 'nope'}}
testDevE2ETurbopack:
name: Test Development (E2E) (Turbopack)
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
# Enabling backtrace will makes snapshot tests fail
RUST_BACKTRACE: 0
# Path to the custom next-swc bindings.
NEXT_BINDINGS_BIN: /work/packages/next-swc/native/next-swc.linux-x64-gnu.node
# Glob pattern to run specific tests with --turbo.
NEXT_DEV_TEST_GLOB: '*'
NEXT_EXTERNAL_TESTS_FILTERS: /work/packages/next-swc/crates/next-dev-tests/tests-manifest.js
strategy:
fail-fast: false
matrix:
node: [18]
group: [1, 2, 3, 4, 5]
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v${{ matrix.node }} | FORCE=1 bash && node -v && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_EXTERNAL_TESTS_FILTERS=${NEXT_EXTERNAL_TESTS_FILTERS} __INTERNAL_NEXT_DEV_TEST_TURBO_DEV=TRUE __INTERNAL_CUSTOM_TURBOPACK_BINDINGS=${NEXT_BINDINGS_BIN} __INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH=${NEXT_DEV_TEST_GLOB} NEXT_E2E_TEST_TIMEOUT=240000 NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=dev TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --type e2e --timings -g ${{ matrix.group }}/5 >> /proc/1/fd/1"
name: Run test/e2e (dev)
if: ${{needs.build.outputs.docsChange == 'nope'}}
- name: Upload test trace
if: always()
uses: actions/upload-artifact@v3
with:
name: test-trace
if-no-files-found: ignore
retention-days: 2
path: |
test/traces
testIntegrationTurbopack:
name: Test Integration (Turbopack)
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 35
env:
NEXT_TELEMETRY_DISABLED: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
# Enabling backtrace will makes snapshot tests fail
RUST_BACKTRACE: 0
# Path to the custom next-swc bindings.
NEXT_BINDINGS_BIN: /work/packages/next-swc/native/next-swc.linux-x64-gnu.node
# Glob pattern to run specific tests with --turbo.
NEXT_DEV_TEST_GLOB: '*'
NEXT_EXTERNAL_TESTS_FILTERS: /work/packages/next-swc/crates/next-dev-tests/tests-manifest.js
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
steps:
- run: echo "${{needs.build.outputs.docsChange}}"
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_EXTERNAL_TESTS_FILTERS=${NEXT_EXTERNAL_TESTS_FILTERS} __INTERNAL_NEXT_DEV_TEST_TURBO_DEV=TRUE __INTERNAL_CUSTOM_TURBOPACK_BINDINGS=${NEXT_BINDINGS_BIN} __INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH=${NEXT_DEV_TEST_GLOB} NEXT_E2E_TEST_TIMEOUT=240000 NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --timings -g ${{ matrix.group }}/10 >> /proc/1/fd/1"
if: ${{needs.build.outputs.docsChange == 'nope'}}
- name: Upload test trace
if: always()
uses: actions/upload-artifact@v3
with:
name: test-trace
if-no-files-found: ignore
retention-days: 2
path: |
test/traces
testsPass:
name: thank you, next
runs-on: ubuntu-latest
needs:
[
lint,
check-examples,
test-native,
test-native-integration,
checkPrecompiled,
testIntegration,
testUnit,
testDevLTS,
testProdLTS,
testDevE2ELTS,
testProdE2ELTS,
]
steps:
- run: exit 0
testFirefox:
name: Test Firefox (production)
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 10
env:
NEXT_TELEMETRY_DISABLED: 1
steps:
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_MAINTENANCE_VERSION }} ./scripts/setup-node.sh && npm i -g pnpm@${PNPM_VERSION} > /dev/null && BROWSERNAME=firefox NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js test/integration/production/test/index.test.js >> /proc/1/fd/1"
if: ${{needs.build.outputs.docsChange == 'nope'}}
testSafari:
name: Test Safari (production)
runs-on: ubuntu-latest
needs: [build, build-native-test]
timeout-minutes: 15
env:
NEXT_TELEMETRY_DISABLED: 1
steps:
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && curl -s https://install-node.vercel.app/v{{ env.NODE_LTS_VERSION }} | FORCE=1 bash && npm i -g pnpm@${PNPM_VERSION} > /dev/null && NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=start BROWSER_NAME=safari node run-tests.js -c 1 test/integration/production/test/index.test.js test/e2e/basepath.test.ts && DEVICE_NAME='iPhone XR' node run-tests.js -c 1 test/production/prerender-prefetch/index.test.ts >> /proc/1/fd/1"
if: ${{needs.build.outputs.docsChange == 'nope'}}
testFirefoxNodeLTS:
name: Test Firefox Node.js LTS
runs-on: ubuntu-latest
needs: [build, testFirefox, build-native-test]
timeout-minutes: 10
env:
NEXT_TELEMETRY_DISABLED: 1
steps:
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && node -v && npm i -g pnpm@${PNPM_VERSION} > /dev/null && BROWSER_NAME=firefox NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js test/integration/production/test/index.test.js >> /proc/1/fd/1"
if: ${{needs.build.outputs.docsChange == 'nope'}}
publishRelease:
if: ${{ needs.build.outputs.isRelease == 'true' }}
name: Potentially publish release
runs-on: ubuntu-latest
needs:
- build
- build-wasm
- build-native
permissions:
contents: write
id-token: write
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
steps:
- name: Setup node
uses: actions/setup-node@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
with:
name: next-swc-binaries
path: packages/next-swc/native
- uses: actions/download-artifact@v3
with:
name: wasm-binaries
path: packages/next-swc/crates/wasm
- run: npm i -g npm@9 # need latest version for provenance
- run: npm i -g pnpm@${PNPM_VERSION}
- run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run: ./scripts/publish-native.js
- run: ./scripts/publish-release.js
deployExamples:
name: Deploy examples
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 25
- name: Install Vercel CLI
run: npm i -g vercel@28.16.15
- name: Deploy preview examples
if: ${{ needs.build.outputs.isRelease != 'true' }}
run: ./scripts/deploy-examples.sh
env:
VERCEL_API_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}
DEPLOY_ENVIRONMENT: preview
- name: Deploy production examples
if: ${{ needs.build.outputs.isRelease == 'true' }}
run: ./scripts/deploy-examples.sh
env:
VERCEL_API_TOKEN: ${{ secrets.VERCEL_API_TOKEN }}
DEPLOY_ENVIRONMENT: production
testDeployE2E:
name: E2E (deploy)
runs-on: ubuntu-latest
needs: [publishRelease, build, build-native-test]
env:
NEXT_TELEMETRY_DISABLED: 1
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_TEAM: vtest314-next-e2e-tests
steps:
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: npm i -g vercel@latest
- run: RESET_VC_PROJECT=true node scripts/reset-vercel-project.mjs
name: Reset test project
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && npm i -g pnpm@${PNPM_VERSION} > /dev/null && VERCEL_TEST_TOKEN=${{ secrets.VERCEL_TEST_TOKEN }} VERCEL_TEST_TEAM=vtest314-next-e2e-tests NEXT_SWC_DEV_BIN=1 NEXT_TEST_JOB=1 NEXT_TEST_MODE=deploy TEST_TIMINGS_TOKEN=${{ secrets.TEST_TIMINGS_TOKEN }} xvfb-run node run-tests.js --type e2e >> /proc/1/fd/1"
name: Run test/e2e (deploy)
- name: Upload test trace
if: always()
uses: actions/upload-artifact@v3
with:
name: test-trace
if-no-files-found: ignore
retention-days: 2
path: |
test/traces
releaseStats:
name: Release Stats
runs-on: ubuntu-latest
needs: [publishRelease, build-native-test]
steps:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- uses: actions/download-artifact@v3
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: cp -r packages/next-swc/native .github/actions/next-stats-action/native
- run: ./scripts/release-stats.sh
- uses: ./.github/actions/next-stats-action
env:
PR_STATS_COMMENT_TOKEN: ${{ secrets.PR_STATS_COMMENT_TOKEN }}
build-native-test:
name: Build native binary for tests and metrics
runs-on: ubuntu-latest-16-core-oss
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: 'vercel'
steps:
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
- uses: actions/checkout@v3
with:
fetch-depth: 25
- run: echo "DOCS_CHANGE<<EOF" >> $GITHUB_OUTPUT; echo "$(node scripts/run-for-change.js --not --type docs --exec echo 'nope')" >> $GITHUB_OUTPUT; echo 'EOF' >> $GITHUB_OUTPUT
id: docs-change
- name: Cache cargo registry
uses: actions/cache@v3
timeout-minutes: 5
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
path: ~/.cargo/registry
key: stable-ubuntu-latest-cargo-registry
- name: Cache cargo index
uses: actions/cache@v3
timeout-minutes: 5
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
path: ~/.cargo/git
key: stable-ubuntu-latest-cargo-index
# We use week in the turbo cache key to keep the cache from infinitely growing
- id: get-week
run: echo "WEEK=$(date +%U)" >> $GITHUB_OUTPUT
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
timeout-minutes: 5
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-
turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-
turbo-${{ github.job }}-canary-${{ steps.get-week.outputs.WEEK }}-
- name: normalize versions
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
run: node scripts/normalize-version-bump.js
- name: Make more disk space
continue-on-error: true
run: sudo rm -rf /usr/local/lib/android
- name: Build in docker
uses: addnab/docker-run-action@v3
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
image: ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2022-10-24-x64
options: -e TURBO_TOKEN=${{ env.TURBO_TOKEN }} -e TURBO_TEAM=${{ env.TURBO_TEAM }} -e RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} -e NAPI_CLI_VERSION=${{ env.NAPI_CLI_VERSION }} -e TURBO_VERSION=${{ env.TURBO_VERSION }} -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build
# turn on some optimization while building Rust codes to prevent tests timeout
run: |
set -e &&
export CARGO_PROFILE_DEV_OPT_LEVEL=1 &&
export CARGO_PROFILE_DEV_INCREMENTAL=false &&
export CARGO_PROFILE_DEV_STRIP=true &&
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
rustup target add x86_64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
unset CC_x86_64_unknown_linux_gnu && unset CC &&
turbo run build-native --cache-dir=".turbo" -- --target x86_64-unknown-linux-gnu &&
strip packages/next-swc/native/next-swc.*.node
- name: Upload artifact
uses: actions/upload-artifact@v3
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
with:
name: next-swc-test-binary
path: packages/next-swc/native/next-swc.linux-x64-gnu.node
- name: Clear the cargo caches
if: ${{ steps.docs-change.outputs.DOCS_CHANGE == 'nope' }}
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache
test-native:
name: Unit Test Native Code
runs-on: ubuntu-latest-8-core-oss
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 25
- run: echo "SWC_CHANGE<<EOF" >> $GITHUB_OUTPUT; echo "$(node scripts/run-for-change.js --type next-swc --exec echo 'yup')" >> $GITHUB_OUTPUT; echo 'EOF' >> $GITHUB_OUTPUT
id: swc-change
- run: echo "${{ steps.swc-change.outputs.SWC_CHANGE }}"
- name: Install
if: ${{ steps.swc-change.outputs.SWC_CHANGE == 'yup' }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
profile: minimal
- run: cd packages/next-swc && cargo test --workspace --exclude next-dev-tests
if: ${{ steps.swc-change.outputs.SWC_CHANGE == 'yup' }}
test-native-integration:
name: Integration Test Native Code
runs-on: ubuntu-latest-16-core-oss
needs: build
env:
CARGO_PROFILE_RELEASE_LTO: false
steps:
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- run: echo "${{needs.build.outputs.docsChange == 'nope'}}"
- name: Install
if: ${{needs.build.outputs.docsChange == 'nope'}}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
profile: minimal
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Build tests
timeout-minutes: 60
run: cd packages/next-swc && cargo nextest run -p next-dev-tests --release --no-run
if: ${{needs.build.outputs.docsChange == 'nope'}}
- name: Run tests
timeout-minutes: 20
run: cd packages/next-swc && cargo nextest run -p next-dev-tests --release --no-fail-fast
if: ${{needs.build.outputs.docsChange == 'nope'}}
test-bench-native-integration:
name: Bench Integration Test Native Code
runs-on: ubuntu-latest-16-core-oss
needs: build
env:
CARGO_PROFILE_RELEASE_LTO: false
TURBOPACK_BENCH_COUNTS: 10
TURBOPACK_BENCH_CACHED: 1
TURBOPACK_BENCH_PROGRESS: 1
steps:
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- run: echo "${{needs.build.outputs.docsChange == 'nope'}}"
- name: Install Rust toolchain
if: ${{needs.build.outputs.docsChange == 'nope'}}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
profile: minimal
- name: Install nextest
uses: taiki-e/install-action@nextest
- name: Build tests
timeout-minutes: 60
run: cd packages/next-swc && cargo test --benches -p next-dev --release --no-run
if: ${{needs.build.outputs.docsChange == 'nope'}}
- name: Run tests
timeout-minutes: 60
run: cd packages/next-swc && cargo test --benches -p next-dev --release --no-fail-fast
if: ${{needs.build.outputs.docsChange == 'nope'}}
test-wasm:
name: Test the wasm build
runs-on: ubuntu-latest
timeout-minutes: 15
needs: [build, build-native-test, build-wasm-dev]
steps:
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: wasm-dev-binary
path: packages/next-swc/crates/wasm/pkg-nodejs
- run: ls packages/next-swc/crates/wasm
if: ${{needs.build.outputs.docsChange == 'nope'}}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- run: docker run --rm -v $(pwd):/work mcr.microsoft.com/playwright:v1.28.1-jammy /bin/bash -c "cd /work && NODE_VERSION=${{ env.NODE_LTS_VERSION }} ./scripts/setup-node.sh && node -v && node ./scripts/setup-wasm.mjs && npm i -g pnpm@${PNPM_VERSION} > /dev/null && TEST_WASM=true xvfb-run node run-tests.js test/integration/production/test/index.test.js test/e2e/streaming-ssr/index.test.ts >> /proc/1/fd/1"
if: ${{needs.build.outputs.docsChange == 'nope'}}
# Build binaries for publishing
build-native:
strategy:
fail-fast: false
matrix:
settings:
# pnpm is aliased here temporarily until the build docker
# image is updated past Node.js v14.19 (current 14.18.1)
- host: macos-latest
target: 'x86_64-apple-darwin'
build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native-release -- --target x86_64-apple-darwin --release
strip -x packages/next-swc/native/next-swc.*.node
- host: windows-latest
build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}"
turbo run build-native-release -- --target x86_64-pc-windows-msvc
target: 'x86_64-pc-windows-msvc'
- host: windows-latest
build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}"
turbo run build-native-no-plugin -- --release --target i686-pc-windows-msvc
target: 'i686-pc-windows-msvc'
- host: ubuntu-latest
target: 'x86_64-unknown-linux-gnu'
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2022-10-24-x64
build: >-
set -e &&
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
rustup target add x86_64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
unset CC_x86_64_unknown_linux_gnu && unset CC &&
turbo run build-native-release -- --target x86_64-unknown-linux-gnu &&
strip packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest
target: 'x86_64-unknown-linux-musl'
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2022-10-24-alpine
build: >-
set -e &&
apk add --no-cache libc6-compat &&
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
rustup target add x86_64-unknown-linux-musl &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
turbo run build-native-release -- --target x86_64-unknown-linux-musl &&
strip packages/next-swc/native/next-swc.*.node
- host: macos-latest
target: 'aarch64-apple-darwin'
build: |
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
export CC=$(xcrun -f clang);
export CXX=$(xcrun -f clang++);
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi
turbo run build-native-release -- --target aarch64-apple-darwin
strip -x packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest
target: 'aarch64-unknown-linux-gnu'
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2022-10-24-aarch64
build: >-
set -e &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
rustup target add aarch64-unknown-linux-gnu &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
export CC_aarch64_unknown_linux_gnu=/usr/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc &&
turbo run build-native-release -- --target aarch64-unknown-linux-gnu &&
llvm-strip -x packages/next-swc/native/next-swc.*.node
- host: ubuntu-latest
target: 'aarch64-unknown-linux-musl'
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:stable-2022-10-24-alpine
build: >-
set -e &&
apk add --no-cache libc6-compat &&
export JEMALLOC_SYS_WITH_LG_PAGE=16 &&
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" && if [ ! -f $(dirname $(which yarn))/pnpm ]; then ln -s $(which yarn) $(dirname $(which yarn))/pnpm;fi &&
rustup toolchain install "${RUST_TOOLCHAIN}" &&
rustup default "${RUST_TOOLCHAIN}" &&
rustup target add aarch64-unknown-linux-musl &&
turbo run build-native-release -- --target aarch64-unknown-linux-musl &&
llvm-strip -x packages/next-swc/native/next-swc.*.node
- host: windows-latest
target: 'aarch64-pc-windows-msvc'
build: |
npm i -g "@napi-rs/cli@${NAPI_CLI_VERSION}" "turbo@${TURBO_VERSION}" "pnpm@${PNPM_VERSION}"
turbo run build-native-no-plugin-woa-release -- --target aarch64-pc-windows-msvc
if: ${{ needs.build.outputs.isRelease == 'true' || (needs.build.outputs.turboToken != 'empty') }}
needs: build
name: stable - ${{ matrix.settings.target }} - node@16
runs-on: ${{ matrix.settings.host }}
env:
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_REMOTE_ONLY: 'true'
steps:
# https://github.com/actions/virtual-environments/issues/1187
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
if: ${{ matrix.settings.host == 'ubuntu-latest' }}
- name: tune linux network
run: sudo ethtool -K eth0 tx off rx off
if: ${{ matrix.settings.host == 'ubuntu-latest' }}
- name: tune windows network
run: Disable-NetAdapterChecksumOffload -Name * -TcpIPv4 -UdpIPv4 -TcpIPv6 -UdpIPv6
if: ${{ matrix.settings.host == 'windows-latest' }}
- name: tune mac network
run: sudo sysctl -w net.link.generic.system.hwcksum_tx=0 && sudo sysctl -w net.link.generic.system.hwcksum_rx=0
if: ${{ matrix.settings.host == 'macos-latest' }}
# we use checkout here instead of the build cache since
# it can fail to restore in different OS'
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
if: ${{ !matrix.settings.docker }}
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- name: Install
uses: actions-rs/toolchain@v1
if: ${{ !matrix.settings.docker }}
with:
profile: minimal
override: true
toolchain: ${{ env.RUST_TOOLCHAIN }}
target: ${{ matrix.settings.target }}
- name: Cache cargo registry
uses: actions/cache@v3
timeout-minutes: 5
with:
path: ~/.cargo/registry
key: ${{ matrix.settings.target }}-cargo-registry
- name: Cache cargo index
uses: actions/cache@v3
timeout-minutes: 5
with:
path: ~/.cargo/git
key: ${{ matrix.settings.target }}-cargo-index
- name: normalize versions
run: node scripts/normalize-version-bump.js
- name: Setup toolchain
run: ${{ matrix.settings.setup }}
if: ${{ matrix.settings.setup }}
shell: bash
- name: Build in docker
uses: addnab/docker-run-action@v3
if: ${{ matrix.settings.docker }}
with:
image: ${{ matrix.settings.docker }}
options: -e RUST_TOOLCHAIN=${{ env.RUST_TOOLCHAIN }} -e NAPI_CLI_VERSION=${{ env.NAPI_CLI_VERSION }} -e TURBO_VERSION=${{ env.TURBO_VERSION }} -e TURBO_TEAM=vercel -e TURBO_TOKEN=${{ secrets.TURBO_TOKEN }} -e TURBO_REMOTE_ONLY=true -v ${{ env.HOME }}/.cargo/git:/root/.cargo/git -v ${{ env.HOME }}/.cargo/registry:/root/.cargo/registry -v ${{ github.workspace }}:/build -w /build
run: ${{ matrix.settings.build }}
- name: 'Build'
run: ${{ matrix.settings.build }}
if: ${{ !matrix.settings.docker }}
shell: bash
- name: Upload artifact
if: ${{ needs.build.outputs.isRelease == 'true' }}
uses: actions/upload-artifact@v3
with:
name: next-swc-binaries
path: packages/next-swc/native/next-swc.*.node
build-wasm:
needs: build
if: ${{ needs.build.outputs.isRelease == 'true' || (needs.build.outputs.turboToken != 'empty') }}
strategy:
matrix:
target: [web, nodejs]
runs-on: macos-latest
env:
TURBO_TEAM: 'vercel'
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_REMOTE_ONLY: 'true'
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
target: wasm32-unknown-unknown
- run: npm i -g turbo@${{ env.TURBO_VERSION }} pnpm@${PNPM_VERSION}
- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: normalize versions
run: node scripts/normalize-version-bump.js
- name: Build
run: turbo run build-wasm -- --target ${{ matrix.target }} --features tracing/release_max_level_info
- name: Add target to folder name
run: '[[ -d "packages/next-swc/crates/wasm/pkg" ]] && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-${{ matrix.target }} || ls packages/next-swc/crates/wasm'
- name: Upload artifact
if: ${{ needs.build.outputs.isRelease == 'true' }}
uses: actions/upload-artifact@v3
with:
name: wasm-binaries
path: packages/next-swc/crates/wasm/pkg-*
build-wasm-dev:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
id: restore-build
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Setup node
if: ${{needs.build.outputs.docsChange == 'nope'}}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- run: npm i -g turbo@${{ env.TURBO_VERSION }} pnpm@${PNPM_VERSION}
- name: Install Rust
if: ${{needs.build.outputs.docsChange == 'nope'}}
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
target: wasm32-unknown-unknown
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
timeout-minutes: 5
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
path: .turbo
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-${{ github.sha }}
restore-keys: |
turbo-${{ github.job }}-
turbo-${{ github.job }}-${{ github.ref_name }}-${{ steps.get-week.outputs.WEEK }}-
turbo-${{ github.job }}-canary-${{ steps.get-week.outputs.WEEK }}-
- name: Install wasm-pack
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- name: normalize versions
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: node scripts/normalize-version-bump.js
- name: Build
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: turbo run build-wasm --cache-dir=".turbo" -- --target nodejs --dev --features tracing/release_max_level_info
- name: Add target to folder name
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: '[[ -d "packages/next-swc/crates/wasm/pkg" ]] && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-nodejs || ls packages/next-swc/crates/wasm'
- name: Upload artifact
if: ${{needs.build.outputs.docsChange == 'nope'}}
uses: actions/upload-artifact@v3
with:
name: wasm-dev-binary
path: packages/next-swc/crates/wasm/pkg-nodejs
check-trace-secrests:
runs-on: ubuntu-latest
outputs:
trace-api-key: ${{ steps.trace-api-key.outputs.defined }}
steps:
- id: trace-api-key
env:
TRACE_API_KEY: ${{ secrets.DATA_DOG_API_KEY }}
if: "${{ env.TRACE_API_KEY != '' }}"
run: echo "defined=true" >> $GITHUB_OUTPUT
build-performance-metrics:
name: Performance Metrics for Release Build
runs-on: ubuntu-latest
needs: [build, build-native-test, check-trace-secrests]
if: needs.check-trace-secrests.outputs.trace-api-key == 'true'
env:
NEXT_TELEMETRY_DISABLED: 1
steps:
- name: Setup node
uses: actions/setup-node@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
node-version: ${{ env.NODE_LTS_VERSION }}
check-latest: true
- uses: actions/cache@v3
timeout-minutes: 5
id: restore-build
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
path: ./*
key: ${{ github.sha }}-${{ github.run_number }}
- name: Set Git Short sha Env
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: echo "GIT_SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Check Git Short sha Env
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: echo ${GIT_SHORT_SHA}
- uses: actions/download-artifact@v3
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
name: next-swc-test-binary
path: packages/next-swc/native
- name: Generate metrics data
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: |
yarn --cwd bench/nested-deps install
node bench/nested-deps/bench.mjs build
- uses: datadog/agent-github-action@v1
if: ${{needs.build.outputs.docsChange == 'nope'}}
with:
api_key: ${{ secrets.DATA_DOG_API_KEY }}
- name: Sending metrics data to Datadog
if: ${{needs.build.outputs.docsChange == 'nope'}}
run: |
node scripts/trace-dd.mjs bench/nested-deps/.next/trace build ${GIT_SHORT_SHA} ./bench/nested-deps/next.config.js
env:
DATA_DOG_API_KEY: ${{ secrets.DATA_DOG_API_KEY }}
DD_TRACE_PARTIAL_FLUSH_MIN_SPANS: 10
DD_ENV: canary
DD_SERVICE: nextjs-dev-build
DD_TRACE_DEBUG: true