Skip to content

Commit 2a6ebd7

Browse files
author
Unitech
committed
add bun support + testing
1 parent 5e20239 commit 2a6ebd7

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

.github/workflows/node.js.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3-
41
name: Node.js CI
52

63
on: [push, pull_request]
74

85
jobs:
9-
build:
10-
6+
node-tests:
117
runs-on: ubuntu-latest
128
timeout-minutes: 30
139

@@ -18,7 +14,6 @@ jobs:
1814

1915
steps:
2016
- uses: actions/checkout@v3
21-
- uses: oven-sh/setup-bun@v1
2217
- name: Use Node.js ${{ matrix.node-version }}
2318
uses: actions/setup-node@v3
2419
with:
@@ -29,3 +24,16 @@ jobs:
2924
- run: npm install
3025
- run: npm run test:e2e
3126
- run: npm run test:unit
27+
28+
bun-tests:
29+
runs-on: ubuntu-latest
30+
timeout-minutes: 30
31+
32+
steps:
33+
- uses: actions/checkout@v3
34+
- uses: oven-sh/setup-bun@v1
35+
- name: Install dependencies using Bun
36+
run: bun install
37+
- name: Run unit tests with Bun
38+
- run: bun run test:e2e
39+
- run: bun run test:unit

pm2

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/bin/bash
22

3-
DIR="$(dirname "$(readlink -f "$0")")"
4-
$DIR/node/bin/node $DIR/bin/pm2 $@
3+
SCRIPT_PATH="$(dirname "$0")/../lib/binaries/CLI.js"
4+
5+
# Check if 'bun' is available, otherwise use 'node'
6+
if command -v bun &> /dev/null
7+
then
8+
bun "$SCRIPT_PATH" "$@"
9+
else
10+
node "$SCRIPT_PATH" "$@"
11+
fi

run.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
# Check if 'bun' is available, otherwise use 'node'
4+
if command -v bun &> /dev/null
5+
then
6+
bun "$@"
7+
else
8+
node "$@"
9+
fi

0 commit comments

Comments
 (0)