feat: update CI/CD to use Bun
- Update Dockerfile to use oven/bun:alpine image - Update PR workflow to use Bun (oven/setup-bun action) - Update Test workflow to use Bun - Update Release workflow to use Bun - Remove test.yml workflow (redundant with PR workflow) - Update Docker build commands to use Bun - Docker build verified working
This commit is contained in:
+10
-10
@@ -9,7 +9,7 @@ jobs:
|
||||
unit-tests:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:20-alpine
|
||||
image: oven/bun:alpine
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
@@ -17,10 +17,10 @@ jobs:
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
run: bun install
|
||||
|
||||
- name: Run unit tests
|
||||
run: npm run test:run
|
||||
run: bun test
|
||||
|
||||
acceptance-tests:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -37,16 +37,16 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v4
|
||||
- name: Setup Bun
|
||||
uses: oven/setup-bun@v2
|
||||
with:
|
||||
node-version: '20'
|
||||
bun-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
run: bun install
|
||||
|
||||
- name: Generate Prisma client
|
||||
run: npx prisma generate
|
||||
run: bun x prisma generate
|
||||
env:
|
||||
DATABASE_URL: postgresql://user:pass@localhost:5432/dummy
|
||||
|
||||
@@ -54,10 +54,10 @@ jobs:
|
||||
run: |
|
||||
# Create SQLite database file
|
||||
mkdir -p prisma
|
||||
npx prisma migrate deploy
|
||||
bun x prisma migrate deploy
|
||||
|
||||
- name: Run acceptance tests
|
||||
run: npm run test:acceptance
|
||||
run: bun run test:acceptance
|
||||
env:
|
||||
DATABASE_PROVIDER: sqlite
|
||||
DATABASE_URL: file:./prisma/ci.db
|
||||
|
||||
@@ -63,6 +63,11 @@ jobs:
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Setup Bun
|
||||
uses: oven/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
|
||||
- name: Bump version
|
||||
id: version
|
||||
run: |
|
||||
@@ -70,10 +75,10 @@ jobs:
|
||||
echo "Bumping version: $BUMP"
|
||||
|
||||
# Run the bump script
|
||||
node scripts/bump-version.js "$BUMP" --yes
|
||||
bun run scripts/bump-version.js "$BUMP" --yes
|
||||
|
||||
# Get new version
|
||||
NEW_VERSION=$(node -p "require('./package.json').version")
|
||||
NEW_VERSION=$(bun -e "console.log(require('./package.json').version)")
|
||||
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT
|
||||
echo "New version: $NEW_VERSION"
|
||||
|
||||
@@ -123,7 +128,7 @@ jobs:
|
||||
docker run --rm \
|
||||
-e DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" \
|
||||
${{ env.IMAGE_NAME }}-test:${{ steps.version.outputs.new_version }} \
|
||||
npm run test:run
|
||||
bun test
|
||||
|
||||
- name: Build production image
|
||||
if: steps.commit.outputs.committed == 'true'
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:20-alpine
|
||||
options: --user root
|
||||
# Skip if this is an auto-generated version bump commit (handled by release workflow)
|
||||
if: "!contains(github.event.head_commit.message, 'chore: bump version')"
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run unit tests
|
||||
run: npm run test:run
|
||||
Reference in New Issue
Block a user