168 lines (143 loc) · 5.46 KB
/
build_and_test.yml
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: build-and-test
on:
push:
branches: ['canary']
pull_request:
types: [opened, synchronize]
env:
NAPI_CLI_VERSION: 2.14.7
TURBO_VERSION: 1.9.6
RUST_TOOLCHAIN: nightly-2023-03-09
PNPM_VERSION: 7.24.3
NODE_MAINTENANCE_VERSION: 16
NODE_LTS_VERSION: 18
TEST_CONCURRENCY: 6
# TODO: remove after testing
# NEXT_TEST_CONTINUE_ON_ERROR: 'true'
TURBO_TEAM: 'vercel'
TURBO_REMOTE_ONLY: 'true'
NEXT_TELEMETRY_DISABLED: 1
DATADOG_API_KEY: ${{ secrets.DATA_DOG_API_KEY }}
# we build a dev binary for use in CI so skip downloading
# canary next-swc binaries in the monorepo
NEXT_SKIP_NATIVE_POSTINSTALL: 1
TEST_TIMINGS_TOKEN: ${{ secrets.TEST_TIMINGS_TOKEN }}
NEXT_TEST_JOB: 1
jobs:
build:
name: build
uses: vercel/next.js/.github/workflows/build_reusable.yml@canary
secrets: inherit
lint:
name: lint
needs: ['build']
uses: vercel/next.js/.github/workflows/build_reusable.yml@canary
with:
afterBuild: pnpm lint-no-typescript && pnpm check-examples
secrets: inherit
check-types-precompiled:
name: types and precompiled
needs: ['build']
uses: vercel/next.js/.github/workflows/build_reusable.yml@canary
with:
afterBuild: pnpm types-and-precompiled
skipForDocsOnly: 'yes'
secrets: inherit
test-cargo-unit:
name: test cargo unit
needs: ['build']
uses: vercel/next.js/.github/workflows/build_reusable.yml@canary
with:
skipForDocsOnly: 'yes'
skipInstallBuild: 'yes'
afterBuild: turbo run test-cargo-unit
secrets: inherit
rust-check:
name: rust check
needs: ['build']
uses: vercel/next.js/.github/workflows/build_reusable.yml@canary
with:
skipForDocsOnly: 'yes'
skipInstallBuild: 'yes'
afterBuild: turbo run rust-check
secrets: inherit
test-turbopack-dev:
name: test turbopack dev
needs: ['build']
uses: vercel/next.js/.github/workflows/build_reusable.yml@canary
with:
skipForDocsOnly: 'yes'
afterBuild: RUST_BACKTRACE=0 NEXT_EXTERNAL_TESTS_FILTERS="$(pwd)/packages/next-swc/crates/next-dev-tests/tests-manifest.js" __INTERNAL_NEXT_DEV_TEST_TURBO_DEV=TRUE __INTERNAL_CUSTOM_TURBOPACK_BINDINGS="$(pwd)/packages/next-swc/native/next-swc.linux-x64-gnu.node" __INTERNAL_NEXT_DEV_TEST_TURBO_GLOB_MATCH="*" NEXT_E2E_TEST_TIMEOUT=240000 NEXT_TEST_MODE=dev node run-tests.js --type development --timings -c ${TEST_CONCURRENCY}
secrets: inherit
test-next-swc-wasm:
name: test next-swc wasm
needs: ['build']
uses: vercel/next.js/.github/workflows/build_reusable.yml@canary
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
test-dev:
name: test dev
needs: ['build']
strategy:
fail-fast: false
matrix:
group: [1, 2, 3]
uses: vercel/next.js/.github/workflows/build_reusable.yml@canary
with:
skipForDocsOnly: 'yes'
afterBuild: NEXT_TEST_MODE=dev node run-tests.js --timings -g ${{ matrix.group }}/3 -c ${TEST_CONCURRENCY} --test-pattern '^(development|e2e|unit)/.*\.test\.(js|jsx|ts|tsx)$'
secrets: inherit
test-prod:
name: test prod
needs: ['build']
strategy:
fail-fast: false
matrix:
group: [1, 2, 3]
uses: vercel/next.js/.github/workflows/build_reusable.yml@canary
with:
skipForDocsOnly: 'yes'
afterBuild: NEXT_TEST_MODE=start node run-tests.js --timings -g ${{ matrix.group }}/3 -c ${TEST_CONCURRENCY} --test-pattern '^(production|e2e)/.*\.test\.(js|jsx|ts|tsx)$'
secrets: inherit
test-integration:
name: test integration
needs: ['build']
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6]
uses: vercel/next.js/.github/workflows/build_reusable.yml@canary
with:
skipForDocsOnly: 'yes'
afterBuild: node run-tests.js --timings -g ${{ matrix.group }}/6 -c ${TEST_CONCURRENCY} --test-pattern '^(integration)/.*\.test\.(js|jsx|ts|tsx)$'
secrets: inherit
test-firefox-safari:
name: test firefox and safari
needs: ['build']
uses: vercel/next.js/.github/workflows/build_reusable.yml@canary
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
tests-pass:
needs:
[
'build',
'lint',
'check-types-precompiled',
'test-dev',
'test-prod',
'test-integration',
'test-cargo-unit',
'rust-check',
'test-next-swc-wasm',
'test-turbopack-dev',
]
if: always()
runs-on: [self-hosted, linux, x64]
name: thank you, next
steps:
- run: exit 1
if: ${{ always() && contains(needs.*.result, 'failure') }}