Skip to content

Commit db3d3c1

Browse files
committed
Update the bun test workflow
1 parent 923176c commit db3d3c1

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

.github/workflows/test-bun.yml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,30 @@ jobs:
1818
runs-on: buildjet-4vcpu-ubuntu-2204
1919
steps:
2020
- uses: actions/checkout@v4
21-
- name: Setup Node
22-
uses: actions/setup-node@v4
23-
with:
24-
node-version: 22
25-
cache: yarn
21+
22+
# Yarn 1 check for engine version and failed with
23+
# error root@: The engine "node" is incompatible with this module. Expected version ">=22 <23". Got "24.3.0"
24+
- name: Install jq
25+
uses: dcarbone/[email protected]
26+
- name: Update engines with Bun's Node version
27+
run: |
28+
echo "NODE_RUNTIME_VERSION=$(bun -e 'console.log(process.versions.node)')" >> "$GITHUB_ENV"
29+
- name: Update package engine dependency
30+
run: |
31+
jq --arg version ">=$NODE_RUNTIME_VERSION" '.engines.node = $version' package.json > temp.json && mv temp.json package.json
32+
- name: Detect engine version
33+
run: |
34+
jq .engines.node package.json
35+
2636
- uses: oven-sh/setup-bun@v2
2737
with:
2838
bun-version: latest
2939
- name: Install Yarn
3040
run: bun install -g npm:yarn
3141
- name: Install
32-
run: yarn install --frozen-lockfile
42+
run: bunx --bun yarn install --frozen-lockfile
3343
- name: Build
34-
run: yarn build
44+
run: bunx --bun run build
3545
- name: Unit Tests
3646
# These packages are not testable yet in Bun because of `@chainsafe/blst` dependency.
3747
run: excluded=(beacon-node prover light-client cli); for pkg in packages/*/; do [[ ! " ${excluded[@]} " =~ " $(basename "$pkg") " ]] && echo "Testing $(basename "$pkg")" && (cd "$pkg" && bun run --bun test:unit); done

0 commit comments

Comments
 (0)