ci) add gitea actions and refresh readme #1

Merged
shaun merged 18 commits from ci/gitea-actions-readme into main 2026-02-21 04:33:49 +00:00
2 changed files with 9 additions and 5 deletions
Showing only changes of commit e5c4cbc331 - Show all commits

View File

@@ -35,7 +35,7 @@ jobs:
run: bun run lint run: bun run lint
- name: Unit tests - name: Unit tests
run: bun run test run: bunx --bun svelte-kit sync && bunx --bun vitest run --maxWorkers=1
- name: Build app - name: Build app
run: bun run build run: bun run build

View File

@@ -3,10 +3,12 @@ import { createSqliteDb } from './sqlite.js';
import { runMigrations } from './migrations.js'; import { runMigrations } from './migrations.js';
import type { Database } from './types.js'; import type { Database } from './types.js';
function createDb(): Database { const isVitest = process.env.VITEST === 'true';
const url = env.DATABASE_URL ?? 'file:trips.db';
if (url.startsWith('file:') || url.endsWith('.db')) { function createDb(): Database {
const url = isVitest ? ':memory:' : (env.DATABASE_URL ?? 'file:trips.db');
if (url === ':memory:' || url.startsWith('file:') || url.endsWith('.db')) {
return createSqliteDb(url); return createSqliteDb(url);
} }
@@ -17,7 +19,9 @@ function createDb(): Database {
export let db: Database = createDb(); export let db: Database = createDb();
if (!isVitest) {
runMigrations(db); runMigrations(db);
}
/** /**
* Replace the database singleton. For use in tests only — call this with an * Replace the database singleton. For use in tests only — call this with an