Skip to content

Latest commit

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

setup-postgres

Lightning-fast Postgres setup for GitHub Actions that just works. Cross-platform, unconfined, and ready for all environments GitHub Actions supports.

Install Times

Features

  • 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

Get Started

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.

Core Features

Version Support

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@v3with:
version: 16.4.0

Environment Configuration

Your workflow steps automatically get these environment variables:

VariablePurposeDefault
PGHOSTConnection hostlocalhost
PGPORTConnection port5432
PGUSERUsernamepostgres
PGPASSWORDPasswordpostgres
PGDATABASETarget databasepostgres
PGDATAData directoryruntime path
DATABASE_URLConnection stringDSN format

The DATABASE_URL uses DSN format for maximum flexibility. For URL format, construct it like this:

postgres://$PGUSER:$PGPASSWORD@$PGHOST:$PGPORT/$PGDATABASE

Configuration Options

Inputs

NamePurposeDefault
versionPostgres version17.2.0

Outputs

For advanced workflow configuration:

NamePurpose
dsnDatabase connection string
dataPostgres data directory

Performance Notes

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.

Acknowledgments

Built on the shoulders of giants:

Contributing

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.*​​​​​​​​​​​​​​​​

About

The fastest PostgreSQL setup for GitHub Actions

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors