Skip to content
Draft

Bun #59

Show file tree
Hide file tree
Changes from all commits
Commits
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
71 changes: 65 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,70 @@ on: [push]
jobs:
test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

mysql:
image: mysql:8.0
env:
MYSQL_ROOT_PASSWORD: ''
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: mysql
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=5
ports:
- 3306:3306

env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
MYSQL_USER: root
MYSQL_PASSWORD: ''

steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
node-version: 20
- run: yarn
- run: yarn test
- run: yarn build
bun-version: 1.2.21
- run: bun install

# Install database client tools
- name: Install PostgreSQL client
run: sudo apt-get install -y postgresql-client
- name: Install MySQL client
run: sudo apt-get install -y mysql-client

# Wait for services to be ready
- name: Wait for PostgreSQL
run: |
until pg_isready -h localhost -p 5432 -U postgres; do
echo "Waiting for PostgreSQL..."
sleep 2
done

- name: Wait for MySQL
run: |
until mysqladmin ping -h 127.0.0.1 -P 3306 --silent; do
echo "Waiting for MySQL..."
sleep 2
done

# Run tests with database services available
- run: bun test
- run: bun run build
18 changes: 10 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ jobs:
if: contains(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
with:
node-version: 20
- run: yarn
- run: yarn test
- run: yarn buildPackage
- name: Publish package
bun-version: 1.2.21
- run: bun install
- run: bun test --ignore "**/postgresql-integration.test.ts" --ignore "**/mysql-integration.test.ts"
- run: bun run buildPackage
- name: Setup npm authentication
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
yarn publish --access public
cat ~/.npmrc
- name: Publish package
run: npm publish --access public
Loading
Loading