2023-05-28 06:02:31 +02:00
|
|
|
name: build-and-test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: ['canary']
|
2023-05-28 07:57:45 +02:00
|
|
|
pull_request:
|
2023-05-28 06:02:31 +02:00
|
|
|
types: [opened, synchronize]
|
|
|
|
|
|
|
|
env:
|
|
|
|
NAPI_CLI_VERSION: 2.14.7
|
2023-07-21 10:04:06 +02:00
|
|
|
TURBO_VERSION: 1.10.9
|
2023-05-28 06:02:31 +02:00
|
|
|
NODE_MAINTENANCE_VERSION: 16
|
2023-09-12 23:47:51 +02:00
|
|
|
NODE_LTS_VERSION: 18
|
2023-08-11 23:05:11 +02:00
|
|
|
TEST_CONCURRENCY: 8
|
2023-06-07 18:53:50 +02:00
|
|
|
# disable backtrace for test snapshots
|
|
|
|
RUST_BACKTRACE: 0
|
2023-05-28 06:02:31 +02:00
|
|
|
|
|
|
|
TURBO_TEAM: 'vercel'
|
|
|
|
TURBO_REMOTE_ONLY: 'true'
|
|
|
|
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
|
2023-06-08 12:52:49 +02:00
|
|
|
DATADOG_API_KEY: ${{ secrets.DATA_DOG_API_KEY }}
|
2023-06-12 19:14:13 +02:00
|
|
|
DATADOG_TRACE_NEXTJS_TEST: 'true'
|
2023-06-08 12:52:49 +02:00
|
|
|
DD_ENV: 'ci'
|
2023-05-28 06:02:31 +02:00
|
|
|
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
|
|
|
|
NEXT_TEST_JOB: 1
|
|
|
|
|
|
|
|
jobs:
|
2023-06-12 16:47:43 +02:00
|
|
|
build-native:
|
|
|
|
name: build-native
|
2023-06-06 18:57:09 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
2023-06-12 16:47:43 +02:00
|
|
|
with:
|
|
|
|
skipInstallBuild: 'yes'
|
2023-09-21 08:14:29 +02:00
|
|
|
# Ensure all of the tests listed in turbopack test manifest actually exists;
|
|
|
|
# i.e after removing an actual test and if it still stays in the manifest
|
|
|
|
afterBuild: node -e 'require(\"./test/turbopack-tests-manifest.js\").verifyEnabledTestPath()'
|
2023-06-12 16:47:43 +02:00
|
|
|
secrets: inherit
|
|
|
|
|
|
|
|
build-next:
|
|
|
|
name: build-next
|
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
|
|
|
with:
|
|
|
|
skipNativeBuild: 'yes'
|
2023-05-28 06:02:31 +02:00
|
|
|
secrets: inherit
|
|
|
|
|
|
|
|
lint:
|
|
|
|
name: lint
|
2023-06-12 16:47:43 +02:00
|
|
|
needs: ['build-native', 'build-next']
|
2023-05-28 06:02:31 +02:00
|
|
|
|
2023-06-06 18:57:09 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
2023-05-28 06:02:31 +02:00
|
|
|
with:
|
|
|
|
afterBuild: pnpm lint-no-typescript && pnpm check-examples
|
|
|
|
secrets: inherit
|
|
|
|
|
2023-07-24 21:35:21 +02:00
|
|
|
validate-docs-links:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
- name: 'Run link checker'
|
|
|
|
run: node ./.github/actions/validate-docs-links/lib
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2023-05-28 06:02:31 +02:00
|
|
|
check-types-precompiled:
|
|
|
|
name: types and precompiled
|
2023-06-12 16:47:43 +02:00
|
|
|
needs: ['build-native', 'build-next']
|
2023-05-28 06:02:31 +02:00
|
|
|
|
2023-06-06 18:57:09 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
2023-05-28 06:02:31 +02:00
|
|
|
with:
|
|
|
|
afterBuild: pnpm types-and-precompiled
|
|
|
|
skipForDocsOnly: 'yes'
|
|
|
|
secrets: inherit
|
|
|
|
|
|
|
|
test-cargo-unit:
|
|
|
|
name: test cargo unit
|
2023-06-12 16:47:43 +02:00
|
|
|
needs: ['build-next']
|
2023-05-28 06:02:31 +02:00
|
|
|
|
2023-06-06 18:57:09 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
2023-05-28 06:02:31 +02:00
|
|
|
with:
|
|
|
|
skipForDocsOnly: 'yes'
|
2023-06-12 16:47:43 +02:00
|
|
|
needsRust: 'yes'
|
2023-05-28 06:02:31 +02:00
|
|
|
skipInstallBuild: 'yes'
|
2023-06-12 16:47:43 +02:00
|
|
|
skipNativeBuild: 'yes'
|
2023-05-28 06:02:31 +02:00
|
|
|
afterBuild: turbo run test-cargo-unit
|
2023-06-22 10:03:44 +02:00
|
|
|
mold: 'yes'
|
2023-05-28 06:02:31 +02:00
|
|
|
secrets: inherit
|
|
|
|
|
2023-06-12 16:47:43 +02:00
|
|
|
test-cargo-integration:
|
|
|
|
name: test cargo integration
|
|
|
|
needs: ['build-next']
|
|
|
|
|
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
|
|
|
with:
|
|
|
|
skipForDocsOnly: 'yes'
|
|
|
|
needsNextest: 'yes'
|
|
|
|
needsRust: 'yes'
|
|
|
|
skipNativeBuild: 'yes'
|
|
|
|
afterBuild: xvfb-run turbo run test-cargo-integration
|
|
|
|
|
|
|
|
test-cargo-bench:
|
|
|
|
name: test cargo benchmarks
|
|
|
|
needs: ['build-next']
|
|
|
|
|
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
|
|
|
with:
|
|
|
|
skipForDocsOnly: 'yes'
|
2023-06-14 23:44:23 +02:00
|
|
|
skipForRelease: 'yes'
|
2023-06-12 16:47:43 +02:00
|
|
|
needsRust: 'yes'
|
|
|
|
skipNativeBuild: 'yes'
|
|
|
|
afterBuild: xvfb-run turbo run test-cargo-bench
|
|
|
|
|
2023-05-28 06:02:31 +02:00
|
|
|
rust-check:
|
|
|
|
name: rust check
|
2023-06-12 16:47:43 +02:00
|
|
|
needs: ['build-next']
|
2023-05-28 06:02:31 +02:00
|
|
|
|
2023-06-06 18:57:09 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
2023-05-28 06:02:31 +02:00
|
|
|
with:
|
|
|
|
skipForDocsOnly: 'yes'
|
2023-06-12 16:47:43 +02:00
|
|
|
needsRust: 'yes'
|
2023-05-28 06:02:31 +02:00
|
|
|
skipInstallBuild: 'yes'
|
2023-06-12 16:47:43 +02:00
|
|
|
skipNativeBuild: 'yes'
|
2023-05-28 06:02:31 +02:00
|
|
|
afterBuild: turbo run rust-check
|
|
|
|
secrets: inherit
|
|
|
|
|
|
|
|
test-turbopack-dev:
|
|
|
|
name: test turbopack dev
|
2023-06-12 16:47:43 +02:00
|
|
|
needs: ['build-native', 'build-next']
|
2023-09-08 19:30:07 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
group: [1, 2, 3, 4, 5]
|
2023-06-06 18:57:09 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
2023-05-28 06:02:31 +02:00
|
|
|
with:
|
|
|
|
skipForDocsOnly: 'yes'
|
2023-09-08 19:30:07 +02:00
|
|
|
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-tests-manifest.js" TURBOPACK=1 NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_MODE=dev node run-tests.js --test-pattern '^(test\/development)/.*\.test\.(js|jsx|ts|tsx)$' --timings -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY}
|
2023-08-02 14:31:52 +02:00
|
|
|
secrets: inherit
|
|
|
|
|
2023-07-04 09:40:50 +02:00
|
|
|
test-turbopack-integration:
|
|
|
|
name: test turbopack integration
|
|
|
|
needs: ['build-native', 'build-next']
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-09-08 19:30:07 +02:00
|
|
|
group: [1, 2, 3, 4, 5]
|
2023-07-04 09:40:50 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
|
|
|
with:
|
|
|
|
nodeVersion: 16
|
|
|
|
skipForDocsOnly: 'yes'
|
2023-09-08 19:30:07 +02:00
|
|
|
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-tests-manifest.js" TURBOPACK=1 node run-tests.js --timings -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --type integration
|
2023-07-04 09:40:50 +02:00
|
|
|
secrets: inherit
|
2023-09-06 19:46:54 +02:00
|
|
|
|
2023-09-21 08:14:29 +02:00
|
|
|
# --type production also runs tests/e2e
|
|
|
|
test-turbopack-prod:
|
|
|
|
name: test turbopack prod
|
|
|
|
needs: ['build-native', 'build-next']
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
group: [1, 2, 3, 4, 5]
|
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
|
|
|
with:
|
|
|
|
nodeVersion: 16
|
|
|
|
skipForDocsOnly: 'yes'
|
|
|
|
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/test/turbopack-tests-manifest.js" TURBOPACK=1 NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --type production
|
|
|
|
secrets: inherit
|
|
|
|
|
2023-05-28 06:02:31 +02:00
|
|
|
test-next-swc-wasm:
|
|
|
|
name: test next-swc wasm
|
2023-06-12 16:47:43 +02:00
|
|
|
needs: ['build-native', 'build-next']
|
2023-06-06 18:57:09 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
2023-05-28 06:02:31 +02:00
|
|
|
with:
|
|
|
|
skipForDocsOnly: 'yes'
|
|
|
|
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 --features tracing/release_max_level_info && git checkout . && mv packages/next-swc/crates/wasm/pkg packages/next-swc/crates/wasm/pkg-nodejs && node ./scripts/setup-wasm.mjs && NEXT_TEST_MODE=start TEST_WASM=true node run-tests.js test/integration/production/test/index.test.js test/e2e/streaming-ssr/index.test.ts
|
|
|
|
secrets: inherit
|
|
|
|
|
2023-09-20 02:34:38 +02:00
|
|
|
test-unit:
|
|
|
|
name: test unit
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
|
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
|
|
|
with:
|
|
|
|
skipForDocsOnly: 'yes'
|
2023-09-20 03:09:26 +02:00
|
|
|
afterBuild: node run-tests.js -c ${TEST_CONCURRENCY} --type unit
|
2023-09-20 02:34:38 +02:00
|
|
|
|
|
|
|
secrets: inherit
|
|
|
|
|
2023-05-28 06:02:31 +02:00
|
|
|
test-dev:
|
|
|
|
name: test dev
|
2023-06-12 16:47:43 +02:00
|
|
|
needs: ['build-native', 'build-next']
|
2023-05-28 06:02:31 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
group: [1, 2, 3]
|
|
|
|
|
2023-06-06 18:57:09 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
2023-05-28 06:02:31 +02:00
|
|
|
with:
|
|
|
|
skipForDocsOnly: 'yes'
|
2023-08-01 02:04:45 +02:00
|
|
|
afterBuild: NEXT_TEST_MODE=dev node run-tests.js --timings -g ${{ matrix.group }}/3 -c ${TEST_CONCURRENCY} --type development
|
2023-07-28 15:54:15 +02:00
|
|
|
|
2023-05-28 06:02:31 +02:00
|
|
|
secrets: inherit
|
|
|
|
|
|
|
|
test-prod:
|
|
|
|
name: test prod
|
2023-06-12 16:47:43 +02:00
|
|
|
needs: ['build-native', 'build-next']
|
2023-05-28 06:02:31 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-07-17 18:19:35 +02:00
|
|
|
group: [1, 2, 3, 4, 5]
|
2023-05-28 06:02:31 +02:00
|
|
|
|
2023-06-06 18:57:09 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
2023-05-28 06:02:31 +02:00
|
|
|
with:
|
|
|
|
skipForDocsOnly: 'yes'
|
2023-08-01 02:04:45 +02:00
|
|
|
afterBuild: NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --type production
|
2023-05-28 06:02:31 +02:00
|
|
|
secrets: inherit
|
|
|
|
|
|
|
|
test-integration:
|
|
|
|
name: test integration
|
2023-06-12 16:47:43 +02:00
|
|
|
needs: ['build-native', 'build-next']
|
2023-05-28 06:02:31 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-07-17 18:19:35 +02:00
|
|
|
group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
|
2023-05-28 06:02:31 +02:00
|
|
|
|
2023-06-06 18:57:09 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
2023-05-28 06:02:31 +02:00
|
|
|
with:
|
2023-06-01 12:43:09 +02:00
|
|
|
nodeVersion: 16
|
2023-05-28 06:02:31 +02:00
|
|
|
skipForDocsOnly: 'yes'
|
2023-08-01 02:04:45 +02:00
|
|
|
afterBuild: node run-tests.js --timings -g ${{ matrix.group }}/12 -c ${TEST_CONCURRENCY} --type integration
|
2023-05-28 06:02:31 +02:00
|
|
|
secrets: inherit
|
|
|
|
|
|
|
|
test-firefox-safari:
|
|
|
|
name: test firefox and safari
|
2023-06-12 16:47:43 +02:00
|
|
|
needs: ['build-native', 'build-next']
|
2023-05-28 06:02:31 +02:00
|
|
|
|
2023-06-06 18:57:09 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
2023-05-28 06:02:31 +02:00
|
|
|
with:
|
|
|
|
skipForDocsOnly: 'yes'
|
|
|
|
afterBuild: pnpm playwright install && BROWSER_NAME=firefox node run-tests.js test/integration/production/test/index.test.js && BROWSER_NAME=safari NEXT_TEST_MODE=start node run-tests.js -c 1 test/integration/production/test/index.test.js 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
|
|
|
|
secrets: inherit
|
|
|
|
|
2023-06-12 19:14:13 +02:00
|
|
|
report-test-results:
|
2023-09-21 08:14:29 +02:00
|
|
|
needs:
|
|
|
|
[
|
|
|
|
'test-unit',
|
|
|
|
'test-dev',
|
|
|
|
'test-prod',
|
|
|
|
'test-integration',
|
|
|
|
'test-turbopack-dev',
|
|
|
|
'test-turbopack-integration',
|
|
|
|
'test-turbopack-prod',
|
|
|
|
]
|
2023-06-13 17:06:15 +02:00
|
|
|
uses: ./.github/workflows/build_reusable.yml
|
|
|
|
with:
|
|
|
|
skipForDocsOnly: 'yes'
|
|
|
|
uploadTestTrace: 'yes'
|
|
|
|
secrets: inherit
|
2023-06-12 19:14:13 +02:00
|
|
|
|
2023-05-28 06:02:31 +02:00
|
|
|
tests-pass:
|
|
|
|
needs:
|
|
|
|
[
|
2023-06-12 16:47:43 +02:00
|
|
|
'build-native',
|
|
|
|
'build-next',
|
2023-05-28 06:02:31 +02:00
|
|
|
'lint',
|
2023-07-24 21:35:21 +02:00
|
|
|
'validate-docs-links',
|
2023-05-28 06:02:31 +02:00
|
|
|
'check-types-precompiled',
|
2023-09-20 02:34:38 +02:00
|
|
|
'test-unit',
|
2023-05-28 06:02:31 +02:00
|
|
|
'test-dev',
|
|
|
|
'test-prod',
|
|
|
|
'test-integration',
|
|
|
|
'test-cargo-unit',
|
2023-06-12 16:47:43 +02:00
|
|
|
'test-cargo-integration',
|
|
|
|
'test-cargo-bench',
|
2023-05-28 06:02:31 +02:00
|
|
|
'rust-check',
|
|
|
|
'test-next-swc-wasm',
|
|
|
|
'test-turbopack-dev',
|
2023-07-04 15:01:33 +02:00
|
|
|
'test-turbopack-integration',
|
2023-05-28 06:02:31 +02:00
|
|
|
]
|
2023-05-31 15:51:13 +02:00
|
|
|
|
|
|
|
if: always()
|
2023-07-04 01:07:28 +02:00
|
|
|
runs-on: ubuntu-latest
|
2023-05-28 06:02:31 +02:00
|
|
|
name: thank you, next
|
|
|
|
steps:
|
2023-05-31 15:51:13 +02:00
|
|
|
- run: exit 1
|
2023-07-05 19:41:22 +02:00
|
|
|
if: ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')) }}
|