Compare commits
3 Commits
00373fcef4
...
fa6c4369a6
| Author | SHA1 | Date | |
|---|---|---|---|
| fa6c4369a6 | |||
| 9c884ee020 | |||
| 5b91cf1426 |
+14
-12
@@ -8,17 +8,18 @@ on:
|
||||
jobs:
|
||||
unit-tests:
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: node:20-alpine
|
||||
options: --user root
|
||||
|
||||
steps:
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
apk add --no-cache bash git
|
||||
|
||||
- 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
|
||||
|
||||
@@ -28,21 +29,22 @@ jobs:
|
||||
acceptance-tests:
|
||||
runs-on: ubuntu-latest
|
||||
needs: unit-tests
|
||||
container:
|
||||
image: node:20-alpine
|
||||
options: --user root
|
||||
env:
|
||||
DATABASE_PROVIDER: sqlite
|
||||
DATABASE_URL: file:./prisma/ci.db
|
||||
BETTER_AUTH_SECRET: test-secret-key-for-ci-only
|
||||
|
||||
steps:
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
apk add --no-cache bash git
|
||||
|
||||
- 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
|
||||
|
||||
|
||||
@@ -8,19 +8,20 @@ on:
|
||||
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: Install system dependencies
|
||||
run: |
|
||||
apk add --no-cache bash git
|
||||
|
||||
- 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
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ format:
|
||||
# --- Testing ---
|
||||
|
||||
# Run all tests (unit + acceptance with SQLite)
|
||||
# Note: Uses Docker containers for consistent environment
|
||||
test: test-unit test-acceptance-sqlite
|
||||
|
||||
# Run all tests with PostgreSQL (Docker)
|
||||
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
# Run tests in a Node.js container (for consistent environment)
|
||||
|
||||
set -e
|
||||
|
||||
echo "Running tests in node:20-alpine container..."
|
||||
echo "This avoids Node.js setup time and ensures consistent environment."
|
||||
echo ""
|
||||
|
||||
# Run unit tests in container
|
||||
docker run --rm \
|
||||
-v "$(pwd):/app" \
|
||||
-w /app \
|
||||
node:20-alpine \
|
||||
sh -c "apk add --no-cache bash git && npm ci && npm run test:run"
|
||||
Reference in New Issue
Block a user