Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update to [email protected] and use node 18 everywhere in CI #5235

Merged
merged 10 commits into from
Aug 11, 2023
Merged
12 changes: 7 additions & 5 deletions .github/actions/setup-node/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,27 @@ runs:
steps:
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 7.12.1

- name: Setup Node.js
uses: actions/[email protected]
with:
node-version: ${{ inputs.node-version }}
cache: pnpm

- name: Configure corepack
if: ${{ inputs.enable-corepack == 'true' }}
- name: Upgrade corepack
if: ${{ inputs.enable-corepack == 'true' && inputs.node-version == '16' }}
shell: bash
# Forcibly upgrade our available version of corepack.
# The bundled version in node 16 has known issues.
# Prepends the npm bin dir so that it is always first.
run: |
npm install --force --global corepack@latest
npm config get prefix >> $GITHUB_PATH
corepack enable

- name: Configure corepack
if: ${{ inputs.enable-corepack == 'true' }}
shell: bash
run: corepack enable

- name: pnpm install
id: install
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/turbopack-bump/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/actions/turbopack-bump/dist/index.js.map

Large diffs are not rendered by default.

29 changes: 21 additions & 8 deletions .github/workflows/nextjs-integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ env:
RUST_BACKTRACE: 0
NEXT_TELEMETRY_DISABLED: 1
TEST_CONCURRENCY: 6
# pnpm version should match to what upstream next.js uses
PNPM_VERSION: 8.6.11
DATADOG_API_KEY: ${{ secrets.DD_KEY_TURBOPACK }}
DATADOG_TRACE_NEXTJS_TEST: "true"
DD_ENV: "ci"
Expand Down Expand Up @@ -75,11 +73,15 @@ jobs:
path: ./*
key: ${{ inputs.version }}-${{ github.sha }}-${{ github.run_id }}-${{ github.run_attempt}}-${{ github.run_number }}
fail-on-cache-miss: true

- name: Enable corepack and install yarn
run: |
corepack enable
corepack prepare --activate [email protected]

- name: Run test/development
run: |
ls $NEXT_TEST_SKIP_RETRY_MANIFEST
npm i -g pnpm@$PNPM_VERSION && pnpm --version
npm i -g yarn
sudo npx playwright install-deps && pnpm playwright install
NEXT_TEST_MODE=dev node run-tests.js -g ${{ matrix.group }}/3 -c ${TEST_CONCURRENCY} --test-pattern '^(test\/(development|e2e|unit)|packages\/.*\/src\/.*)/.*\.test\.(js|jsx|ts|tsx)$'
ls test/turbopack-test-junit-report
Expand All @@ -88,6 +90,7 @@ jobs:
env:
# marker to parse log output, do not delete / change.
NEXT_INTEGRATION_TEST: true

- name: Upload test reports artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -112,16 +115,21 @@ jobs:
path: ./*
key: ${{ inputs.version }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Enable corepack and install yarn
run: |
corepack enable
corepack prepare --activate [email protected]

- name: Run test/production
run: |
npm i -g pnpm@$PNPM_VERSION && pnpm --version
npm i -g yarn
sudo npx playwright install-deps && pnpm playwright install
NEXT_TEST_MODE=start node run-tests.js -g ${{ matrix.group }}/5 -c ${TEST_CONCURRENCY} --test-pattern '^(test\/(production|e2e))/.*\.test\.(js|jsx|ts|tsx)$'
ls test/turbopack-test-junit-report
continue-on-error: true
env:
NEXT_INTEGRATION_TEST: true

- name: Upload test reports artifact
uses: actions/upload-artifact@v3
with:
Expand All @@ -146,16 +154,21 @@ jobs:
path: ./*
key: ${{ inputs.version }}-${{ github.sha }}
fail-on-cache-miss: true

- name: Enable corepack and install yarn
run: |
corepack enable
corepack prepare --activate [email protected]

- name: Run test/integration
run: |
npm i -g pnpm@$PNPM_VERSION && pnpm --version
npm i -g yarn
sudo npx playwright install-deps && pnpm playwright install
node run-tests.js -g ${{ matrix.group }}/12 -c ${TEST_CONCURRENCY} --test-pattern '^(test\/integration)/.*\.test\.(js|jsx|ts|tsx)$'
ls test/turbopack-test-junit-report
continue-on-error: true
env:
NEXT_INTEGRATION_TEST: true

- name: Upload test reports artifact
uses: actions/upload-artifact@v3
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/setup-nextjs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ jobs:
runs-on: ubuntu-latest-16-core-oss
outputs:
output1: ${{ steps.build-next-swc-turbopack-patch.outputs.success }}
env:
# pnpm version should match to what upstream next.js uses
PNPM_VERSION: 8.6.11
steps:
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
Expand Down Expand Up @@ -76,7 +73,7 @@ jobs:
run: |
wget https://github.com/sharkdp/hyperfine/releases/download/v1.16.1/hyperfine_1.16.1_amd64.deb
sudo dpkg -i hyperfine_1.16.1_amd64.deb
npm i -g pnpm@$PNPM_VERSION && pnpm --version
corepack enable
pnpm install --loglevel error

- name: Build next-swc with latest turbopack
Expand Down
18 changes: 4 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,6 @@ jobs:
# work out of box. We should take another stab at it later.
- name: Setup Pnpm
uses: pnpm/[email protected]
with:
version: 7.2.1

- name: Make sure pnpm always has a cache
shell: bash
Expand Down Expand Up @@ -736,9 +734,7 @@ jobs:
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
# TODO: update to Node 18. Currently fails because the node-canvas dependency doesn't compile for node 18
# Did not spend too much time investigating so it could be an easy fix.
node-version: 16
node-version: 18

- name: Install tests dependencies
working-directory: crates/turbopack/tests/node-file-trace
Expand Down Expand Up @@ -797,9 +793,7 @@ jobs:
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
# TODO: update to Node 18. Currently fails because the node-canvas dependency doesn't compile for node 18
# Did not spend too much time investigating so it could be an easy fix.
node-version: 16
node-version: 18

- name: Setup Protoc
uses: arduino/setup-protoc@v1
Expand Down Expand Up @@ -873,9 +867,7 @@ jobs:
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
# TODO: update to Node 18. Currently fails because the node-canvas dependency doesn't compile for node 18
# Did not spend too much time investigating so it could be an easy fix.
node-version: 16
node-version: 18

- name: Build benchmarks for tests
timeout-minutes: 120
Expand Down Expand Up @@ -940,9 +932,7 @@ jobs:
- name: Setup Node.js
uses: ./.github/actions/setup-node
with:
# TODO: update to Node 18. Currently fails because the node-canvas dependency doesn't compile for node 18
# Did not spend too much time investigating so it could be an easy fix.
node-version: 16
node-version: 18

- name: Build benchmarks for tests
timeout-minutes: 120
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
auto-install-peers = true
hoist-pattern[]=vfile-message
resolution-mode=highest
dedupe-direct-deps=true
2 changes: 1 addition & 1 deletion benchmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
"lint:prettier": "prettier -c . --cache --ignore-path=../.prettierignore"
},
"devDependencies": {
"@types/node": "^16.11.49"
"@types/node": "^18.17.2"
}
}
8 changes: 3 additions & 5 deletions crates/turbopack/tests/node-file-trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ static ALLOC: turbo_tasks_malloc::TurboMalloc = turbo_tasks_malloc::TurboMalloc;
#[case::stripe("integration/stripe.js")]
#[case::strong_error_handler("integration/strong-error-handler.js")]
#[case::symlink_to_file("integration/symlink-to-file/index.js")]
#[case::tensorflow("integration/tensorflow.js")]
#[case::tiny_json_http("integration/tiny-json-http.js")]
#[case::twilio("integration/twilio.js")]
#[case::ts_morph("integration/ts-morph.js")]
Expand All @@ -174,12 +173,11 @@ static ALLOC: turbo_tasks_malloc::TurboMalloc = turbo_tasks_malloc::TurboMalloc;
#[case::webpack_target_node("integration/webpack-target-node/index.js")]
#[case::whatwg_url("integration/whatwg-url.js")]
#[case::when("integration/when.js")]
// These two tests print a deprecation warning about using folders in exports field to stderr.
#[case::package_exports_alt_folders_base(
CaseInput::new("integration/package-exports/pass/alt-folders.js").expected_stderr("DeprecationWarning")
CaseInput::new("integration/package-exports/pass/alt-folders.js").expected_stderr("Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath")
)]
#[case::package_exports_folder(
CaseInput::new("integration/package-exports/pass/folder.js").expected_stderr("DeprecationWarning")
CaseInput::new("integration/package-exports/pass/folder.js").expected_stderr("Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath")
)]
#[case::package_exports_alt_base("integration/package-exports/pass/alt.js")]
#[case::package_exports_catch_all("integration/package-exports/pass/catch-all.js")]
Expand All @@ -202,7 +200,7 @@ static ALLOC: turbo_tasks_malloc::TurboMalloc = turbo_tasks_malloc::TurboMalloc;
#[case::package_exports_package_sub_suffix_base("integration/package-exports/pass/sub-suffix.js")]
#[case::package_exports_alt_folders_multiple(
CaseInput::new("integration/package-exports/fail/alt-folders-multiple.js")
.expected_stderr("Error [ERR_MODULE_NOT_FOUND]: Cannot find module")
.expected_stderr("Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath")
)]
#[case::package_exports_alt_multiple(
CaseInput::new("integration/package-exports/fail/alt-multiple.js")
Expand Down

This file was deleted.

17 changes: 1 addition & 16 deletions crates/turbopack/tests/node-file-trace/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"@google-cloud/firestore": "^4.11.0",
"@mdx-js/node-loader": "^2.2.1",
"@sentry/node": "^5.5.0",
"@tensorflow/tfjs-node": "^3.20.0",
"@tpluscode/sparql-builder": "^0.3.12",
"@types/bindings": "^1.3.0",
"@types/debug": "^4.1.7",
Expand All @@ -35,7 +34,7 @@
"bull": "^3.10.0",
"bullmq": "^1.87.1",
"camaro": "^6.1.0",
"canvas": "^2.9.0",
"canvas": "^2.11.2",
"chromeless": "^1.5.2",
"codecov": "^3.8.1",
"consolidate": "^0.15.1",
Expand Down Expand Up @@ -121,19 +120,5 @@
},
"optionalDependencies": {
"oracledb": "^4.2.0"
},
"pnpm": {
"packageExtensions": {
"@tensorflow/tfjs": {
"peerDependencies": {
"long": "^5.2.0"
}
},
"@tensorflow/tfjs-node": {
"peerDependencies": {
"@tensorflow/tfjs-core": "^3.20.0"
}
}
}
}
}
Loading