diff --git a/.github/workflows/presubmit.yaml b/.github/workflows/presubmit.yaml index 9c37deef21d..a908025cdc5 100644 --- a/.github/workflows/presubmit.yaml +++ b/.github/workflows/presubmit.yaml @@ -15,9 +15,7 @@ jobs: uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} - - uses: pnpm/action-setup@v4 - with: - version: ^10.0.0 + - uses: oven-sh/setup-bun@v2 - run: node --version - run: ci/run_conditional_tests.sh name: Run unit tests diff --git a/.github/workflows/windows-presubmit.yaml b/.github/workflows/windows-presubmit.yaml index 624c0f32a7c..a24c82a14e7 100644 --- a/.github/workflows/windows-presubmit.yaml +++ b/.github/workflows/windows-presubmit.yaml @@ -15,9 +15,7 @@ jobs: uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} - - uses: pnpm/action-setup@v4 - with: - version: ^10.0.0 + - uses: oven-sh/setup-bun@v2 - run: node --version - run: bash ci/run_conditional_tests.sh name: Run windows unit tests @@ -25,3 +23,5 @@ jobs: env: BUILD_TYPE: presubmit TEST_TYPE: units + SHELL: C:\Program Files\Git\bin\bash.exe + npm_config_script_shell: bash diff --git a/ci/run_conditional_tests.sh b/ci/run_conditional_tests.sh index 573a74e2c04..4862dcf3a02 100755 --- a/ci/run_conditional_tests.sh +++ b/ci/run_conditional_tests.sh @@ -30,6 +30,10 @@ fi # A script file for running the test in a sub project. test_script="${PROJECT_ROOT}/ci/run_single_test.sh" +# Install all dependencies globally to give Bun the opportunity to deduplicate +# dependencies. +bun install --ignore-scripts + if [ ${BUILD_TYPE} == "presubmit" ]; then # For presubmit build, we want to know the difference from the diff --git a/ci/run_single_test.sh b/ci/run_single_test.sh index 31ce0206111..10c66258930 100755 --- a/ci/run_single_test.sh +++ b/ci/run_single_test.sh @@ -39,30 +39,33 @@ if [ ${BUILD_TYPE} != "presubmit" ]; then export MOCHA_REPORTER=xunit fi -# Install dependencies -echo "pnpm install --ignore-scripts --engine-strict --prod; pnpm install" -pnpm install --ignore-scripts --engine-strict --prod; pnpm install - +# Run post install scripts. +# Of the available post-install scripts, our repo only uses "prepare". +echo "run post install scripts . . ." +# Run script only if its defined. +jq -e '.scripts.prepare' package.json > /dev/null && npm run prepare retval=0 +# We use `npm run` here so that the test run respects the Node version +# configured for this test run. set +e case ${TEST_TYPE} in lint) - pnpm prelint - pnpm lint + npm run prelint + npm run lint retval=$? ;; samples) - pnpm samples-test + npm run samples-test retval=$? ;; system) - pnpm system-test + npm run system-test retval=$? ;; units) - pnpm test + npm run test retval=$? ;; *) diff --git a/package.json b/package.json index 9fe35bf5b43..c8f9b0c591b 100644 --- a/package.json +++ b/package.json @@ -44,5 +44,10 @@ }, "engines": { "node": ">=18" - } + }, + "workspaces": [ + "packages/*", + "handwritten/*", + ".github/scripts/*" + ] } \ No newline at end of file