ci: add unit and acceptance tests to PR workflow with SQLite
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user