GitHub Action to run integration tests with ephemeral TrashDB databases.
Creates a container, injects the connection string into the environment, runs your test command, and cleans up.
- uses: trashdb/run-tests@v1
with:
api-key: ${{ secrets.TRASHDB_API_KEY }}
engine: postgres
run: npm test| Name | Required | Default | Description |
|---|---|---|---|
api-key |
yes | — | TrashDB API key |
engine |
yes | — | postgres, redis, mongodb, chromadb, qdrant, supabase |
run |
yes | — | Command to execute (e.g. npm test) |
ttl-minutes |
no | 15 |
Container TTL in minutes |
base-url |
no | https://api.trashdb.dev/api/v1 |
API base URL |
| Engine | Env var | Also sets |
|---|---|---|
| postgres | DATABASE_URL |
PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE |
| supabase | DATABASE_URL |
PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE |
| redis | REDIS_URL |
— |
| mongodb | MONGODB_URI |
— |
| chromadb | CHROMA_URL |
— |
| qdrant | QDRANT_URL |
— |
Your tests read process.env.DATABASE_URL (or the corresponding env var) like any normal database connection.
MIT