Skip to content

Commit

Permalink
Install and test client using Bun
Browse files Browse the repository at this point in the history
  • Loading branch information
malthe committed Dec 15, 2023
1 parent 9c0711e commit a1c172b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
- type: node
version: 18.x
- type: node
version: 20.x
- type: bun
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
Expand All @@ -66,6 +68,9 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.environment.version }}
- name: Use Bun ${{ matrix.environment.version }}
if: matrix.environment.type == 'bun'
uses: oven-sh/setup-bun@v1
- name: Install dependencies
if: matrix.environment.type == 'node'
run: npm ci
Expand Down Expand Up @@ -102,6 +107,15 @@ jobs:
gen_code ./dist/src/index.js > test.mjs
node test.mjs | tee /dev/stderr | grep -q true
;;
bun)
# Workaround: https://github.com/oven-sh/bun/issues/1590
dependencies=`jq -r '.dependencies|to_entries|map("\(.key)@\(.value)")|join(" ")' package.json`
( set -x; mkdir /tmp/bun && cd "$_" && ls -lah && bun install -p "$dependencies" && rm -rf `pwd`; )
bun install -p --ignore-scripts
bun build src/index.ts --target bun > ts-postgres.js
gen_code ./ts-postgres.js > test.mjs
bun test.mjs | tee /dev/stderr | grep -q true
;;
esac
env:
ENVIRONMENT: ${{ matrix.environment.type }}
Expand Down

0 comments on commit a1c172b

Please sign in to comment.