From c0593441ec82adcfab29b3047968a1cf47449ac2 Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Mon, 13 Jan 2025 22:23:41 -0800 Subject: [PATCH] update config --- .github/workflows/build_and_test.yml | 728 ++++++++++++++------------- 1 file changed, 366 insertions(+), 362 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index b4f38616a42ec..bd97bff02df52 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -208,126 +208,126 @@ jobs: stepName: 'devlow-bench-${{ matrix.mode }}-${{ matrix.selector }}' secrets: inherit - # test-devlow: - # name: test devlow package - # needs: ['optimize-ci', 'changes'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - # strategy: - # fail-fast: false - # uses: ./.github/workflows/build_reusable.yml - # with: - # stepName: 'test-devlow' - # afterBuild: pnpm install && pnpm run --filter=devlow-bench test - # secrets: inherit - - # test-turbopack-dev: - # name: test turbopack dev - # needs: ['optimize-ci', 'changes', 'build-next', 'build-native'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # strategy: - # fail-fast: false - # matrix: - # exclude: - # # Excluding React 18 tests unless on `canary` branch until budget is approved. - # - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }} - # group: [1/5, 2/5, 3/5, 4/5, 5/5] - # # Empty value uses default - # react: ['', '18.3.1'] - # uses: ./.github/workflows/build_reusable.yml - # with: - # afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-dev-tests-manifest.json" TURBOPACK=1 TURBOPACK_DEV=1 NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_MODE=dev NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --test-pattern '^(test\/(development|e2e))/.*\.test\.(js|jsx|ts|tsx)$' --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} - # stepName: 'test-turbopack-dev-react-${{ matrix.react }}-${{ matrix.group }}' - # secrets: inherit - - # test-turbopack-integration: - # name: test turbopack development integration - # needs: ['optimize-ci', 'changes', 'build-next', 'build-native'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # strategy: - # fail-fast: false - # matrix: - # exclude: - # # Excluding React 18 tests unless on `canary` branch until budget is approved. - # - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }} - # group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6] - # # Empty value uses default - # react: [''] - # uses: ./.github/workflows/build_reusable.yml - # with: - # nodeVersion: 18.18.2 - # afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-dev-tests-manifest.json" TURBOPACK=1 TURBOPACK_DEV=1 NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type integration - # stepName: 'test-turbopack-integration-react-${{ matrix.react }}-${{ matrix.group }}' - # secrets: inherit - - # test-turbopack-production: - # name: test turbopack production - # needs: ['optimize-ci', 'changes', 'build-next', 'build-native'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # strategy: - # fail-fast: false - # matrix: - # exclude: - # # Excluding React 18 tests unless on `canary` branch until budget is approved. - # - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }} - # group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7] - # # Empty value uses default - # # TODO: Run with React 18. - # # Integration tests use the installed React version in next/package.json.include: - # # We can't easily switch like we do for e2e tests. - # # Skipping this dimensions until we can figure out a way to test multiple React versions. - # react: ['', '18.3.1'] - # uses: ./.github/workflows/build_reusable.yml - # with: - # nodeVersion: 18.18.2 - # afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-build-tests-manifest.json" TURBOPACK=1 TURBOPACK_BUILD=1 NEXT_TEST_MODE=start NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type production - # stepName: 'test-turbopack-production-react-${{ matrix.react }}-${{ matrix.group }}' - # secrets: inherit - - # test-turbopack-production-integration: - # name: test turbopack production integration - # needs: ['optimize-ci', 'changes', 'build-next', 'build-native'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # strategy: - # fail-fast: false - # matrix: - # group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7] - # uses: ./.github/workflows/build_reusable.yml - # with: - # nodeVersion: 18.18.2 - # afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-build-tests-manifest.json" TURBOPACK=1 TURBOPACK_BUILD=1 node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type integration - # stepName: 'test-turbopack-production-integration-${{ matrix.group }}' - # secrets: inherit - - # test-next-swc-wasm: - # name: test next-swc wasm - # needs: ['optimize-ci', 'changes', 'build-next'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # uses: ./.github/workflows/build_reusable.yml - # with: - # afterBuild: rustup target add wasm32-unknown-unknown && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && node ./scripts/normalize-version-bump.js && turbo run build-wasm -- --target nodejs && git checkout . && mv crates/wasm/pkg crates/wasm/pkg-nodejs && node ./scripts/setup-wasm.mjs && NEXT_TEST_MODE=start TEST_WASM=true node run-tests.js test/production/pages-dir/production/test/index.test.ts test/e2e/streaming-ssr/index.test.ts - # stepName: 'test-next-swc-wasm' - # secrets: inherit + test-devlow: + name: test devlow package + needs: ['optimize-ci', 'changes'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + strategy: + fail-fast: false + uses: ./.github/workflows/build_reusable.yml + with: + stepName: 'test-devlow' + afterBuild: pnpm install && pnpm run --filter=devlow-bench test + secrets: inherit + + test-turbopack-dev: + name: test turbopack dev + needs: ['optimize-ci', 'changes', 'build-next', 'build-native'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + strategy: + fail-fast: false + matrix: + exclude: + # Excluding React 18 tests unless on `canary` branch until budget is approved. + - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }} + group: [1/5, 2/5, 3/5, 4/5, 5/5] + # Empty value uses default + react: ['', '18.3.1'] + uses: ./.github/workflows/build_reusable.yml + with: + afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-dev-tests-manifest.json" TURBOPACK=1 TURBOPACK_DEV=1 NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_MODE=dev NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --test-pattern '^(test\/(development|e2e))/.*\.test\.(js|jsx|ts|tsx)$' --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} + stepName: 'test-turbopack-dev-react-${{ matrix.react }}-${{ matrix.group }}' + secrets: inherit + + test-turbopack-integration: + name: test turbopack development integration + needs: ['optimize-ci', 'changes', 'build-next', 'build-native'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + strategy: + fail-fast: false + matrix: + exclude: + # Excluding React 18 tests unless on `canary` branch until budget is approved. + - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }} + group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6] + # Empty value uses default + react: [''] + uses: ./.github/workflows/build_reusable.yml + with: + nodeVersion: 18.18.2 + afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-dev-tests-manifest.json" TURBOPACK=1 TURBOPACK_DEV=1 NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type integration + stepName: 'test-turbopack-integration-react-${{ matrix.react }}-${{ matrix.group }}' + secrets: inherit + + test-turbopack-production: + name: test turbopack production + needs: ['optimize-ci', 'changes', 'build-next', 'build-native'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + strategy: + fail-fast: false + matrix: + exclude: + # Excluding React 18 tests unless on `canary` branch until budget is approved. + - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }} + group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7] + # Empty value uses default + # TODO: Run with React 18. + # Integration tests use the installed React version in next/package.json.include: + # We can't easily switch like we do for e2e tests. + # Skipping this dimensions until we can figure out a way to test multiple React versions. + react: ['', '18.3.1'] + uses: ./.github/workflows/build_reusable.yml + with: + nodeVersion: 18.18.2 + afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-build-tests-manifest.json" TURBOPACK=1 TURBOPACK_BUILD=1 NEXT_TEST_MODE=start NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type production + stepName: 'test-turbopack-production-react-${{ matrix.react }}-${{ matrix.group }}' + secrets: inherit + + test-turbopack-production-integration: + name: test turbopack production integration + needs: ['optimize-ci', 'changes', 'build-next', 'build-native'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + strategy: + fail-fast: false + matrix: + group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7] + uses: ./.github/workflows/build_reusable.yml + with: + nodeVersion: 18.18.2 + afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-build-tests-manifest.json" TURBOPACK=1 TURBOPACK_BUILD=1 node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type integration + stepName: 'test-turbopack-production-integration-${{ matrix.group }}' + secrets: inherit + + test-next-swc-wasm: + name: test next-swc wasm + needs: ['optimize-ci', 'changes', 'build-next'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + uses: ./.github/workflows/build_reusable.yml + with: + afterBuild: rustup target add wasm32-unknown-unknown && curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh && node ./scripts/normalize-version-bump.js && turbo run build-wasm -- --target nodejs && git checkout . && mv crates/wasm/pkg crates/wasm/pkg-nodejs && node ./scripts/setup-wasm.mjs && NEXT_TEST_MODE=start TEST_WASM=true node run-tests.js test/production/pages-dir/production/test/index.test.ts test/e2e/streaming-ssr/index.test.ts + stepName: 'test-next-swc-wasm' + secrets: inherit #[NOTE] currently this only checks building wasi target - # test-next-swc-napi-wasi: - # name: test next-swc wasi - # needs: ['optimize-ci', 'changes', 'build-next'] - # # TODO: Re-enable this when https://github.com/napi-rs/napi-rs/issues/2009 is addressed. - # # Specifically, the `platform` value is now `threads` in - # # https://github.com/napi-rs/napi-rs/blob/e4ad4767efaf093fdff3dc768856f6100a6e3f72/cli/src/api/build.ts#L530 - # if: false - # # if: ${{ needs.changes.outputs.docs-only == 'false' }} - - # uses: ./.github/workflows/build_reusable.yml - # with: - # afterBuild: rustup target add wasm32-wasip1-threads && turbo run build-native-wasi - # stepName: 'test-next-swc-napi-wasi' - # secrets: inherit + test-next-swc-napi-wasi: + name: test next-swc wasi + needs: ['optimize-ci', 'changes', 'build-next'] + # TODO: Re-enable this when https://github.com/napi-rs/napi-rs/issues/2009 is addressed. + # Specifically, the `platform` value is now `threads` in + # https://github.com/napi-rs/napi-rs/blob/e4ad4767efaf093fdff3dc768856f6100a6e3f72/cli/src/api/build.ts#L530 + if: false + # if: ${{ needs.changes.outputs.docs-only == 'false' }} + + uses: ./.github/workflows/build_reusable.yml + with: + afterBuild: rustup target add wasm32-wasip1-threads && turbo run build-native-wasi + stepName: 'test-next-swc-napi-wasi' + secrets: inherit test-unit: name: test unit @@ -367,77 +367,77 @@ jobs: secrets: inherit - # test-new-tests-dev: - # name: Test new tests for flakes (dev) - # needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # strategy: - # fail-fast: false - # matrix: - # group: [1/5, 2/5, 3/5, 4/5, 5/5] - - # uses: ./.github/workflows/build_reusable.yml - # with: - # afterBuild: node scripts/test-new-tests.mjs --flake-detection --mode dev --group ${{ matrix.group }} - # stepName: 'test-new-tests-dev-${{matrix.group}}' - - # secrets: inherit - - # test-new-tests-start: - # name: Test new tests for flakes (prod) - # needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # strategy: - # fail-fast: false - # matrix: - # group: [1/5, 2/5, 3/5, 4/5, 5/5] - - # uses: ./.github/workflows/build_reusable.yml - # with: - # afterBuild: node scripts/test-new-tests.mjs --flake-detection --mode start --group ${{ matrix.group }} - # stepName: 'test-new-tests-start-${{matrix.group}}' - - # secrets: inherit - - # test-new-tests-deploy: - # name: Test new tests when deployed - # needs: - # ['optimize-ci', 'test-prod', 'test-new-tests-dev', 'test-new-tests-start'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork }} - - # strategy: - # fail-fast: false - # matrix: - # group: [1/5, 2/5, 3/5, 4/5, 5/5] - - # uses: ./.github/workflows/build_reusable.yml - # with: - # afterBuild: NEXT_E2E_TEST_TIMEOUT=240000 node scripts/test-new-tests.mjs --mode deploy --group ${{ matrix.group }} - # stepName: 'test-new-tests-deploy-${{matrix.group}}' - - # secrets: inherit - - # test-dev: - # name: test dev - # needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # strategy: - # fail-fast: false - # matrix: - # exclude: - # # Excluding React 18 tests unless on `canary` branch until budget is approved. - # - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }} - # group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6] - # # Empty value uses default - # react: ['', '18.3.1'] - # uses: ./.github/workflows/build_reusable.yml - # with: - # afterBuild: NEXT_TEST_MODE=dev NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type development - # stepName: 'test-dev-react-${{ matrix.react }}-${{ matrix.group }}' - # secrets: inherit + test-new-tests-dev: + name: Test new tests for flakes (dev) + needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + strategy: + fail-fast: false + matrix: + group: [1/5, 2/5, 3/5, 4/5, 5/5] + + uses: ./.github/workflows/build_reusable.yml + with: + afterBuild: node scripts/test-new-tests.mjs --flake-detection --mode dev --group ${{ matrix.group }} + stepName: 'test-new-tests-dev-${{matrix.group}}' + + secrets: inherit + + test-new-tests-start: + name: Test new tests for flakes (prod) + needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + strategy: + fail-fast: false + matrix: + group: [1/5, 2/5, 3/5, 4/5, 5/5] + + uses: ./.github/workflows/build_reusable.yml + with: + afterBuild: node scripts/test-new-tests.mjs --flake-detection --mode start --group ${{ matrix.group }} + stepName: 'test-new-tests-start-${{matrix.group}}' + + secrets: inherit + + test-new-tests-deploy: + name: Test new tests when deployed + needs: + ['optimize-ci', 'test-prod', 'test-new-tests-dev', 'test-new-tests-start'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork }} + + strategy: + fail-fast: false + matrix: + group: [1/5, 2/5, 3/5, 4/5, 5/5] + + uses: ./.github/workflows/build_reusable.yml + with: + afterBuild: NEXT_E2E_TEST_TIMEOUT=240000 node scripts/test-new-tests.mjs --mode deploy --group ${{ matrix.group }} + stepName: 'test-new-tests-deploy-${{matrix.group}}' + + secrets: inherit + + test-dev: + name: test dev + needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + strategy: + fail-fast: false + matrix: + exclude: + # Excluding React 18 tests unless on `canary` branch until budget is approved. + - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }} + group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6] + # Empty value uses default + react: ['', '18.3.1'] + uses: ./.github/workflows/build_reusable.yml + with: + afterBuild: NEXT_TEST_MODE=dev NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type development + stepName: 'test-dev-react-${{ matrix.react }}-${{ matrix.group }}' + secrets: inherit test-dev-windows: name: test dev windows @@ -474,7 +474,7 @@ jobs: uses: ./.github/workflows/build_reusable.yml with: nodeVersion: 18.18.2 - afterBuild: node run-tests.js -c 4 test/production/pages-dir/production/test/index.test.ts test/integration/css-client-nav/test/index.test.js test/integration/rewrites-has-condition/test/index.test.js test/integration/create-next-app/examples.test.ts test/integration/create-next-app/index.test.ts test/integration/create-next-app/package-manager/pnpm.test.ts + afterBuild: node run-tests.js -c ${TEST_CONCURRENCY} test/production/pages-dir/production/test/index.test.ts test/integration/css-client-nav/test/index.test.js test/integration/rewrites-has-condition/test/index.test.js test/integration/create-next-app/examples.test.ts test/integration/create-next-app/index.test.ts test/integration/create-next-app/package-manager/pnpm.test.ts stepName: 'test-integration-windows' runs_on_labels: '["windows","self-hosted","x64"]' buildNativeTarget: 'x86_64-pc-windows-msvc' @@ -500,186 +500,190 @@ jobs: buildNativeTarget: 'x86_64-pc-windows-msvc' secrets: inherit - # test-prod: - # name: test prod - # needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # strategy: - # fail-fast: false - # matrix: - # exclude: - # # Excluding React 18 tests unless on `canary` branch until budget is approved. - # - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }} - # group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7] - # # Empty value uses default - # react: ['', '18.3.1'] - # uses: ./.github/workflows/build_reusable.yml - # with: - # afterBuild: NEXT_TEST_MODE=start NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type production - # stepName: 'test-prod-react-${{ matrix.react }}-${{ matrix.group }}' - # secrets: inherit - - # test-integration: - # name: test integration - # needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # strategy: - # fail-fast: false - # matrix: - # group: - # - 1/13 - # - 2/13 - # - 3/13 - # - 4/13 - # - 5/13 - # - 6/13 - # - 7/13 - # - 8/13 - # - 9/13 - # - 10/13 - # - 11/13 - # - 12/13 - # - 13/13 - # # Empty value uses default - # # TODO: Run with React 18. - # # Integration tests use the installed React version in next/package.json.include: - # # We can't easily switch like we do for e2e tests. - # # Skipping this dimensions until we can figure out a way to test multiple React versions. - # react: [''] - # uses: ./.github/workflows/build_reusable.yml - # with: - # nodeVersion: 18.18.2 - # afterBuild: NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type integration - # stepName: 'test-integration-${{ matrix.group }}-react-${{ matrix.react }}' - # secrets: inherit - - # test-firefox-safari: - # name: test firefox and safari - # needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # uses: ./.github/workflows/build_reusable.yml - # with: - # afterBuild: pnpm playwright install && - # BROWSER_NAME=firefox node run-tests.js test/production/pages-dir/production/test/index.test.ts && - # NEXT_TEST_MODE=start BROWSER_NAME=safari node run-tests.js -c 1 test/production/pages-dir/production/test/index.test.ts test/e2e/basepath.test.ts && - # BROWSER_NAME=safari DEVICE_NAME='iPhone XR' node run-tests.js -c 1 test/production/prerender-prefetch/index.test.ts - - # stepName: 'test-firefox-safari' - # secrets: inherit - - # # TODO: remove these jobs once PPR is the default - # # Manifest generated via: https://gist.github.com/wyattjoh/2ceaebd82a5bcff4819600fd60126431 - # test-ppr-integration: - # name: test ppr integration - # needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # uses: ./.github/workflows/build_reusable.yml - # with: - # nodeVersion: 18.18.2 - # afterBuild: __NEXT_EXPERIMENTAL_PPR=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" node run-tests.js --timings -c ${TEST_CONCURRENCY} --type integration - # stepName: 'test-ppr-integration' - # secrets: inherit - - # test-ppr-dev: - # name: test ppr dev - # needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # strategy: - # fail-fast: false - # matrix: - # group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6] - # uses: ./.github/workflows/build_reusable.yml - # with: - # afterBuild: __NEXT_EXPERIMENTAL_PPR=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" NEXT_TEST_MODE=dev node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type development - # stepName: 'test-ppr-dev-${{ matrix.group }}' - # secrets: inherit - - # test-ppr-prod: - # name: test ppr prod - # needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] - # if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} - - # strategy: - # fail-fast: false - # matrix: - # group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7] - # uses: ./.github/workflows/build_reusable.yml - # with: - # afterBuild: __NEXT_EXPERIMENTAL_PPR=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type production - # stepName: 'test-ppr-prod-${{ matrix.group }}' - # secrets: inherit - - # report-test-results-to-datadog: - # needs: - # [ - # 'changes', - # 'test-unit', - # 'test-dev', - # 'test-prod', - # 'test-integration', - # 'test-ppr-dev', - # 'test-ppr-prod', - # 'test-ppr-integration', - # 'test-turbopack-dev', - # 'test-turbopack-integration', - # 'test-turbopack-production', - # 'test-turbopack-production-integration', - # ] - # if: ${{ always() && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork }} - - # runs-on: ubuntu-latest - # name: report test results to datadog - # steps: - # - name: Download test report artifacts - # id: download-test-reports - # uses: actions/download-artifact@v4 - # with: - # pattern: test-reports-* - # path: test - # merge-multiple: true - - # - name: Upload test report to datadog - # run: | - # if [ -d ./test/test-junit-report ]; then - # # Add a `test.type` tag to distinguish between turbopack and next.js runs - # DD_ENV=ci npx @datadog/datadog-ci@2.23.1 junit upload --tags test.type:nextjs --service nextjs ./test/test-junit-report - # fi - - # if [ -d ./test/turbopack-test-junit-report ]; then - # # Add a `test.type` tag to distinguish between turbopack and next.js runs - # DD_ENV=ci npx @datadog/datadog-ci@2.23.1 junit upload --tags test.type:turbopack --service nextjs ./test/turbopack-test-junit-report - # fi + test-prod: + name: test prod + needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + strategy: + fail-fast: false + matrix: + exclude: + # Excluding React 18 tests unless on `canary` branch until budget is approved. + - react: ${{ github.event_name == 'pull_request' && !contains(github.event.pull_request.labels.*.name, 'run-react-18-tests') && '18.3.1' }} + group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7] + # Empty value uses default + react: ['', '18.3.1'] + uses: ./.github/workflows/build_reusable.yml + with: + afterBuild: NEXT_TEST_MODE=start NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type production + stepName: 'test-prod-react-${{ matrix.react }}-${{ matrix.group }}' + secrets: inherit + + test-integration: + name: test integration + needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + strategy: + fail-fast: false + matrix: + group: + - 1/13 + - 2/13 + - 3/13 + - 4/13 + - 5/13 + - 6/13 + - 7/13 + - 8/13 + - 9/13 + - 10/13 + - 11/13 + - 12/13 + - 13/13 + # Empty value uses default + # TODO: Run with React 18. + # Integration tests use the installed React version in next/package.json.include: + # We can't easily switch like we do for e2e tests. + # Skipping this dimensions until we can figure out a way to test multiple React versions. + react: [''] + uses: ./.github/workflows/build_reusable.yml + with: + nodeVersion: 18.18.2 + afterBuild: NEXT_TEST_REACT_VERSION="${{ matrix.react }}" node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type integration + stepName: 'test-integration-${{ matrix.group }}-react-${{ matrix.react }}' + secrets: inherit + + test-firefox-safari: + name: test firefox and safari + needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + uses: ./.github/workflows/build_reusable.yml + with: + afterBuild: pnpm playwright install && + BROWSER_NAME=firefox node run-tests.js test/production/pages-dir/production/test/index.test.ts && + NEXT_TEST_MODE=start BROWSER_NAME=safari node run-tests.js -c 1 test/production/pages-dir/production/test/index.test.ts test/e2e/basepath.test.ts && + BROWSER_NAME=safari DEVICE_NAME='iPhone XR' node run-tests.js -c 1 test/production/prerender-prefetch/index.test.ts + + stepName: 'test-firefox-safari' + secrets: inherit + + # TODO: remove these jobs once PPR is the default + # Manifest generated via: https://gist.github.com/wyattjoh/2ceaebd82a5bcff4819600fd60126431 + test-ppr-integration: + name: test ppr integration + needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + uses: ./.github/workflows/build_reusable.yml + with: + nodeVersion: 18.18.2 + afterBuild: __NEXT_EXPERIMENTAL_PPR=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" node run-tests.js --timings -c ${TEST_CONCURRENCY} --type integration + stepName: 'test-ppr-integration' + secrets: inherit + + test-ppr-dev: + name: test ppr dev + needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + strategy: + fail-fast: false + matrix: + group: [1/6, 2/6, 3/6, 4/6, 5/6, 6/6] + uses: ./.github/workflows/build_reusable.yml + with: + afterBuild: __NEXT_EXPERIMENTAL_PPR=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" NEXT_TEST_MODE=dev node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type development + stepName: 'test-ppr-dev-${{ matrix.group }}' + secrets: inherit + + test-ppr-prod: + name: test ppr prod + needs: ['optimize-ci', 'changes', 'build-native', 'build-next'] + if: ${{ needs.optimize-ci.outputs.skip == 'false' && needs.changes.outputs.docs-only == 'false' }} + + strategy: + fail-fast: false + matrix: + group: [1/7, 2/7, 3/7, 4/7, 5/7, 6/7, 7/7] + uses: ./.github/workflows/build_reusable.yml + with: + afterBuild: __NEXT_EXPERIMENTAL_PPR=true NEXT_EXTERNAL_TESTS_FILTERS="test/ppr-tests-manifest.json" NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }} -c ${TEST_CONCURRENCY} --type production + stepName: 'test-ppr-prod-${{ matrix.group }}' + secrets: inherit + + report-test-results-to-datadog: + needs: + [ + 'changes', + 'test-unit', + 'test-dev', + 'test-prod', + 'test-integration', + 'test-ppr-dev', + 'test-ppr-prod', + 'test-ppr-integration', + 'test-turbopack-dev', + 'test-turbopack-integration', + 'test-turbopack-production', + 'test-turbopack-production-integration', + ] + if: ${{ always() && needs.changes.outputs.docs-only == 'false' && !github.event.pull_request.head.repo.fork }} + + runs-on: ubuntu-latest + name: report test results to datadog + steps: + - name: Download test report artifacts + id: download-test-reports + uses: actions/download-artifact@v4 + with: + pattern: test-reports-* + path: test + merge-multiple: true + + - name: Upload test report to datadog + run: | + if [ -d ./test/test-junit-report ]; then + # Add a `test.type` tag to distinguish between turbopack and next.js runs + DD_ENV=ci npx @datadog/datadog-ci@2.23.1 junit upload --tags test.type:nextjs --service nextjs ./test/test-junit-report + fi + + if [ -d ./test/turbopack-test-junit-report ]; then + # Add a `test.type` tag to distinguish between turbopack and next.js runs + DD_ENV=ci npx @datadog/datadog-ci@2.23.1 junit upload --tags test.type:turbopack --service nextjs ./test/turbopack-test-junit-report + fi tests-pass: - needs: [ + needs: + [ 'build-native', 'build-next', 'lint', 'validate-docs-links', 'check-types-precompiled', 'test-unit', - # 'test-dev', - # 'test-prod', - # 'test-integration', - # 'test-firefox-safari', - # 'test-ppr-dev', - # 'test-ppr-prod', - # 'test-ppr-integration', - # 'test-cargo-unit', - # 'rust-check', - # 'test-next-swc-wasm', - # 'test-turbopack-dev', - # 'test-turbopack-integration', - # 'test-new-tests-dev', - # 'test-new-tests-start', - # 'test-new-tests-deploy', - # 'test-turbopack-production', - # 'test-turbopack-production-integration', + 'test-dev', + 'test-prod', + 'test-integration', + 'test-firefox-safari', + 'test-ppr-dev', + 'test-ppr-prod', + 'test-ppr-integration', + 'test-cargo-unit', + 'rust-check', + 'test-next-swc-wasm', + 'test-turbopack-dev', + 'test-turbopack-integration', + 'test-new-tests-dev', + 'test-new-tests-start', + 'test-new-tests-deploy', + 'test-turbopack-production', + 'test-turbopack-production-integration', + 'test-dev-windows', + 'test-integration-windows', + 'test-prod-windows', ] if: always()