ci: add unit and acceptance tests to PR workflow with SQLite

This commit is contained in:
2026-03-31 21:48:39 -07:00
parent ff7461973a
commit 6b70c3f388
3 changed files with 109 additions and 8 deletions
+57
View File
@@ -6,8 +6,65 @@ on:
- main
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run unit tests
run: npm run test:run
acceptance-tests:
runs-on: ubuntu-latest
needs: unit-tests
env:
DATABASE_PROVIDER: sqlite
DATABASE_URL: file:./prisma/ci.db
BETTER_AUTH_SECRET: test-secret-key-for-ci-only
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Generate Prisma client
run: npx prisma generate
- name: Setup SQLite database
run: |
# Create SQLite database file
mkdir -p prisma
npx prisma migrate deploy
- name: Run acceptance tests
run: npm run test:acceptance
env:
DATABASE_PROVIDER: sqlite
DATABASE_URL: file:./prisma/ci.db
BETTER_AUTH_SECRET: test-secret-key-for-ci-only
analyze-bump-type:
runs-on: ubuntu-latest
needs: acceptance-tests
steps:
- name: Checkout code