Skip to content
Draft
4 changes: 1 addition & 3 deletions .github/workflows/presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows-presubmit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ 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
shell: bash
env:
BUILD_TYPE: presubmit
TEST_TYPE: units
SHELL: C:\Program Files\Git\bin\bash.exe
npm_config_script_shell: bash
4 changes: 4 additions & 0 deletions ci/run_conditional_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 12 additions & 9 deletions ci/run_single_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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=$?
;;
*)
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,10 @@
},
"engines": {
"node": ">=18"
}
},
"workspaces": [
"packages/*",
"handwritten/*",
".github/scripts/*"
]
}
Loading