Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 32 additions & 7 deletions .github/workflows/test-bun.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,45 @@ jobs:
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: yarn
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install Yarn
run: bun install -g npm:yarn

# This is ideal way to install with Yarn and not change the lock file
# But it is causing the error like SSL Error: https://registry.npmjs.org/<package-name>.tgz does not support SSL
# - name: Install
# run: HTTP_PROXY= HTTPS_PROXY= NO_PROXY="*" bunx --bun yarn install --ignore-engines --frozen-lockfile --registry https://registry.npmjs.org/

- name: Install deps for Bun to work with node native bindings
run: bun install -g npm:node-gyp-build

- name: Install
run: yarn install --frozen-lockfile
run: bun install --no-save || true

# Bun is not installing binaries for the packages
# defined as dev dependencies and only been listed
# in the root of the workspace. Reinstalling those will
# make sure their binaries are available in `node_modules/.bin`
- name: Install binaries for tools
run: |
export V=$(jq -r .version node_modules/typescript/package.json) && bun remove typescript && bun install --dev typescript@$V
export V=$(jq -r .version node_modules/@biomejs/biome) && bun remove @biomejs/biome && bun install --dev @biomejs/biome@$V
export V=$(jq -r .version node_modules/lerna) && bun remove lerna && bun install --dev lerna@$V
export V=$(jq -r .version node_modules/vitest) && bun remove vitest && bun install --dev vitest@$V
bun install @lerna-lite/run

# For vitest it is even stranger that `bun install` is not generating binary
# So have to install it as global package
- name: Install vitest binary
run: |
export V=$(jq -r .version node_modules/vitest) && bun remove vitest && bun install -g vitest@$V

- name: Build
run: yarn build
run: bun run --bun build

- name: Unit Tests
# These packages are not testable yet in Bun because of `@chainsafe/blst` dependency.
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
Expand Down
3 changes: 3 additions & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[install]
registry = "https://registry.npmjs.org/"
linker = "hoisted"
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
},
"devDependencies": {
"@actions/core": "^1.11.1",
"@biomejs/biome": "^1.9.4",
"@chainsafe/benchmark": "^1.2.3",
"@chainsafe/biomejs-config": "^0.1.2",
"@biomejs/biome": "^1.9.4",
"@types/node": "^20.12.8",
"@vitest/browser": "3.0.9",
"@vitest/coverage-v8": "3.0.9",
Expand Down Expand Up @@ -82,5 +82,11 @@
"loupe": "^2.3.6",
"testcontainers/**/nan": "^2.19.0",
"vitest": "3.0.9"
}
},
"trustedDependencies": [
"@biomejs/biome",
"classic-level",
"esbuild",
"nx"
]
}
3 changes: 1 addition & 2 deletions packages/beacon-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"@lodestar/validator": "^1.33.0",
"@multiformats/multiaddr": "^12.1.3",
"datastore-core": "^10.0.2",
"datastore-level": "^11.0.1",
"datastore-level": "^11.0.3",
"deepmerge": "^4.3.1",
"fastify": "^5.2.1",
"interface-datastore": "^8.3.0",
Expand All @@ -150,7 +150,6 @@
"xxhash-wasm": "1.0.2"
},
"devDependencies": {
"@types/datastore-level": "^3.0.0",
"@types/qs": "^6.9.7",
"@types/tmp": "^0.2.3",
"it-drain": "^3.0.3",
Expand Down
Loading
Loading