The missing action for Postgres 🎉
- Faster (with the default version) and simpler than containers
- Works on Linux, Mac, and Windows
- Supports different versions
Add it as a step to your workflow
- uses: ankane/setup-postgres@v1
Specify a version
- uses: ankane/setup-postgres@v1
with:
postgres-version: 17
Currently supports
Version | 17 |
16 |
15 |
14 |
13 |
---|---|---|---|---|---|
ubuntu-24.04 |
✓ | default | ✓ | ✓ | ✓ |
ubuntu-24.04-arm |
✓ | default | ✓ | ✓ | ✓ |
ubuntu-22.04 |
✓ | ✓ | ✓ | default | ✓ |
ubuntu-22.04-arm |
✓ | ✓ | ✓ | default | ✓ |
macos-15 |
default | ✓ | ✓ | ✓ | ✓ |
macos-14 |
default | ✓ | ✓ | ✓ | ✓ |
macos-13 |
default | ✓ | ✓ | ✓ | ✓ |
windows-2025 |
default | ||||
windows-2022 |
default | ||||
windows-2019 |
default |
Test against multiple versions
strategy:
matrix:
postgres-version: [17, 16, 15, 14, 13]
steps:
- uses: ankane/setup-postgres@v1
with:
postgres-version: ${{ matrix.postgres-version }}
Create a database
- uses: ankane/setup-postgres@v1
with:
database: testdb
Set postgresql.conf
config
- uses: ankane/setup-postgres@v1
with:
config: |
shared_preload_libraries = 'pg_stat_statements'
Install development files (for building extensions)
- uses: ankane/setup-postgres@v1
with:
dev-files: true
Run queries
- run: psql -d testdb -c 'SHOW server_version'
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features