Skip to content

Commit

Permalink
add bun support + testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Oct 17, 2024
1 parent 5e20239 commit 2a6ebd7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# 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
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs

name: Node.js CI

on: [push, pull_request]

jobs:
build:

node-tests:
runs-on: ubuntu-latest
timeout-minutes: 30

Expand All @@ -18,7 +14,6 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
Expand All @@ -29,3 +24,16 @@ jobs:
- run: npm install
- run: npm run test:e2e
- run: npm run test:unit

bun-tests:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v3
- uses: oven-sh/setup-bun@v1
- name: Install dependencies using Bun
run: bun install
- name: Run unit tests with Bun
- run: bun run test:e2e
- run: bun run test:unit
11 changes: 9 additions & 2 deletions pm2
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash

DIR="$(dirname "$(readlink -f "$0")")"
$DIR/node/bin/node $DIR/bin/pm2 $@
SCRIPT_PATH="$(dirname "$0")/../lib/binaries/CLI.js"

# Check if 'bun' is available, otherwise use 'node'
if command -v bun &> /dev/null
then
bun "$SCRIPT_PATH" "$@"
else
node "$SCRIPT_PATH" "$@"
fi
9 changes: 9 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Check if 'bun' is available, otherwise use 'node'
if command -v bun &> /dev/null
then
bun "$@"
else
node "$@"
fi

0 comments on commit 2a6ebd7

Please sign in to comment.