diff --git a/.github/workflows/mobile.yml b/.github/workflows/mobile.yml index 9c0dce4ed7d..0f39b9c1f4a 100644 --- a/.github/workflows/mobile.yml +++ b/.github/workflows/mobile.yml @@ -298,8 +298,19 @@ jobs: echo 'should_run=true' >> "$GITHUB_OUTPUT" fi - - name: Setup Bun for tests + - name: Find installed Bun + id: installed-bun if: steps.test-scope.outputs.should_run != 'false' + shell: bash + working-directory: . + run: | + bun="$GITHUB_WORKSPACE/node_modules/.bin/bun" + if [ -x "$bun" ] && [ "$("$bun" --version)" = "$(cat config/.bun-version)" ]; then + echo "$GITHUB_WORKSPACE/node_modules/.bin" >> "$GITHUB_PATH" + echo 'found=true' >> "$GITHUB_OUTPUT" + fi + - name: Setup Bun for tests + if: steps.test-scope.outputs.should_run != 'false' && steps.installed-bun.outputs.found != 'true' uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version-file: config/.bun-version @@ -431,7 +442,18 @@ jobs: run: node scripts/check-tests-typecheck-ratchet.mjs # Run all golden consumers, including mutant/page-bridge suites; failures name the recording and rpc:record command. + - name: Find installed Bun + id: installed-bun + shell: bash + working-directory: . + run: | + bun="$GITHUB_WORKSPACE/node_modules/.bin/bun" + if [ -x "$bun" ] && [ "$("$bun" --version)" = "$(cat config/.bun-version)" ]; then + echo "$GITHUB_WORKSPACE/node_modules/.bin" >> "$GITHUB_PATH" + echo 'found=true' >> "$GITHUB_OUTPUT" + fi - name: Setup Bun for tests + if: steps.installed-bun.outputs.found != 'true' uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 with: bun-version-file: config/.bun-version diff --git a/.github/workflows/node-server-tests.yml b/.github/workflows/node-server-tests.yml index 4d704d4437e..18334d1e587 100644 --- a/.github/workflows/node-server-tests.yml +++ b/.github/workflows/node-server-tests.yml @@ -183,8 +183,18 @@ jobs: # Design D7 upgrade and rollback: the last Bun orcad, built from a main commit that shipped # it, using the current Bun pin beside this checkout's Node slot; hand-over skips once PROTOCOL_VERSION # moves past the Bun daemon's. Install its pinned dependencies independently of this checkout. - - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + - name: Find installed Bun + id: installed-bun if: runner.os == 'Linux' + shell: bash + run: | + bun="$GITHUB_WORKSPACE/node_modules/.bin/bun" + if [ -x "$bun" ] && [ "$("$bun" --version)" = "$(cat config/.bun-version)" ]; then + echo "$GITHUB_WORKSPACE/node_modules/.bin" >> "$GITHUB_PATH" + echo 'found=true' >> "$GITHUB_OUTPUT" + fi + - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + if: runner.os == 'Linux' && steps.installed-bun.outputs.found != 'true' with: bun-version-file: config/.bun-version no-cache: true diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 671ab785da7..0473b42de3b 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -94,7 +94,17 @@ jobs: run: | ELECTRON_RUN_AS_NODE=1 "$(node -p "require('electron')")" --version + - name: Find installed Bun + id: installed-bun + shell: bash + run: | + bun="$GITHUB_WORKSPACE/node_modules/.bin/bun" + if [ -x "$bun" ] && [ "$("$bun" --version)" = "$(cat config/.bun-version)" ]; then + echo "$GITHUB_WORKSPACE/node_modules/.bin" >> "$GITHUB_PATH" + echo 'found=true' >> "$GITHUB_OUTPUT" + fi - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0 + if: steps.installed-bun.outputs.found != 'true' with: bun-version-file: config/.bun-version no-cache: true