Lightning-fast Postgres setup for GitHub Actions that just works. Cross-platform, unconfined, and ready for all environments GitHub Actions supports.
- Pure Speed: Binary-based installation that gets you running in seconds
- Zero Friction: No Docker, no package managers - just what you need
- Universal: Works across every OS and architecture GitHub Actions supports
- No yaml hassle: Environment variables pre-configured for immediate use in following steps, without intermediate yaml
steps:
- uses: bmizerany/setup-postgres@v3
# Your steps here
- run: psql 'SELECT 1'
- run: go test ./...
- run: bun test
That's all it takes. No configuration needed.
The default version is 17.2.0
.
Install any Postgres version using standard semantic versioning (X.Y.Z
). We pull directly from the embedded-postgres project's verified binaries.
Browse available versions here.
Versions can be specified using the version input:
steps:
- uses: bmizerany/setup-postgres@v3
with:
version: 16.4.0
Your workflow steps automatically get these environment variables:
Variable | Purpose | Default |
---|---|---|
PGHOST |
Connection host | localhost |
PGPORT |
Connection port | 5432 |
PGUSER |
Username | postgres |
PGPASSWORD |
Password | postgres |
PGDATABASE |
Target database | postgres |
PGDATA |
Data directory | runtime path |
DATABASE_URL |
Connection string | DSN format |
The DATABASE_URL
uses DSN format for maximum flexibility. For URL format, construct it like this:
postgres://$PGUSER:$PGPASSWORD@$PGHOST:$PGPORT/$PGDATABASE
Name | Purpose | Default |
---|---|---|
version |
Postgres version | 17.2.0 |
For advanced workflow configuration:
Name | Purpose |
---|---|
dsn |
Database connection string |
data |
Postgres data directory |
This action runs Postgres in fast mode, disabling fsync
and full_page_writes
. Perfect for CI/CD, not recommended for production. Your tests will fly.
Built on the shoulders of giants:
- embedded postgres project for their essential binary distributions
- The Postgres community for their foundational work
We value collaboration:
- Open issues for features and bugs
- Discuss major changes before PR
- Small fixes welcome anytime
- Be kind, or else
*Note: This project thrives because of community support. Consider supporting the embedded postgres project if you find value here.*