diff --git a/.github/workflows/presubmit-bun.yaml b/.github/workflows/presubmit-bun.yaml new file mode 100644 index 000000000000..b9fbf4acfec3 --- /dev/null +++ b/.github/workflows/presubmit-bun.yaml @@ -0,0 +1,34 @@ +permissions: + contents: read + +on: + pull_request: +name: presubmit-bun +jobs: + units: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + with: + fetch-depth: 300 + persist-credentials: false + # Node.js is required by pnpm for installing dependencies. + - name: Use Node.js 24 + uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 + with: + node-version: 24 + # We continue to use PNPM (rather than Bun) for installation for consistent + # lockfile/version management between CI/runtimes. + - uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4 + with: + version: ^10.0.0 + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + with: + bun-version: 1.3.14 + - run: bun --version + - run: ci/run_conditional_tests.sh + name: Run unit tests with Bun + env: + BUILD_TYPE: presubmit + TEST_TYPE: units + TEST_CMD: bun run diff --git a/ci/run_conditional_tests.sh b/ci/run_conditional_tests.sh index 5e10d220da66..9e06c59a7891 100755 --- a/ci/run_conditional_tests.sh +++ b/ci/run_conditional_tests.sh @@ -61,11 +61,10 @@ set -e if [[ "${changed}" -eq 0 ]]; then echo "no change detected in ci" else - echo "skipping trigger of tests for now: tracking in #7540" - # echo "change detected in ci, we should test everything" - # echo "result of git diff ${GIT_DIFF_ARG} ci:" - # git diff ${GIT_DIFF_ARG} ci - # GIT_DIFF_ARG="" + echo "change detected in ci, we should test everything" + echo "result of git diff ${GIT_DIFF_ARG} ci:" + git diff ${GIT_DIFF_ARG} ci + GIT_DIFF_ARG="" fi # Now we have a fixed list, but we can change it to autodetect if diff --git a/ci/run_single_test.sh b/ci/run_single_test.sh index 13b2d43d1782..6fa45a2c44b2 100755 --- a/ci/run_single_test.sh +++ b/ci/run_single_test.sh @@ -29,6 +29,8 @@ if [ -z "${TEST_TYPE}" ]; then TEST_TYPE="units" fi +TEST_CMD=${TEST_CMD:-pnpm} + d=$(pwd) PROJECT=$(basename ${d}) @@ -76,20 +78,20 @@ fi set +e case ${TEST_TYPE} in lint) - pnpm prelint - pnpm lint + ${TEST_CMD} prelint + ${TEST_CMD} lint retval=$? ;; samples) - pnpm samples-test + ${TEST_CMD} samples-test retval=$? ;; system) - pnpm system-test + ${TEST_CMD} system-test retval=$? ;; units) - pnpm test + ${TEST_CMD} test retval=$? ;; *)