https://github.com/ankane/setup-postgres
The missing action for Postgres
https://github.com/ankane/setup-postgres
Last synced: 8 days ago
JSON representation
The missing action for Postgres
- Host: GitHub
- URL: https://github.com/ankane/setup-postgres
- Owner: ankane
- License: mit
- Created: 2020-11-11T03:22:23.000Z (over 4 years ago)
- Default Branch: v1
- Last Pushed: 2025-03-06T17:32:02.000Z (about 1 month ago)
- Last Synced: 2025-04-03T04:35:59.165Z (12 days ago)
- Language: JavaScript
- Homepage:
- Size: 51.8 KB
- Stars: 51
- Watchers: 3
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- jimsghstars - ankane/setup-postgres - The missing action for Postgres (JavaScript)
README
# setup-postgres
The missing action for Postgres :tada:
- Faster (with the default version) and simpler than containers
- Works on Linux, Mac, and Windows
- Supports different versions[](https://github.com/ankane/setup-postgres/actions)
## Getting Started
Add it as a step to your workflow
```yml
- uses: ankane/setup-postgres@v1
```## Versions
Specify a version
```yml
- uses: ankane/setup-postgres@v1
with:
postgres-version: 17
```Currently supports
Version | `17` | `16` | `15` | `14` | `13`
--- | --- | --- | --- | --- | ---
Ubuntu 24.04 | ✓ | default | ✓ | ✓ | ✓
Ubuntu (rest) | ✓ | ✓ | ✓ | default | ✓
Mac | default | ✓ | ✓ | ✓ | ✓
Windows 2025 | default | | | | |
Windows (rest) | | | | default | |Test against multiple versions
```yml
strategy:
matrix:
postgres-version: [17, 16, 15, 14, 13]
steps:
- uses: ankane/setup-postgres@v1
with:
postgres-version: ${{ matrix.postgres-version }}
```## Options
Create a database
```yml
- uses: ankane/setup-postgres@v1
with:
database: testdb
```Set `postgresql.conf` config
```yml
- uses: ankane/setup-postgres@v1
with:
config: |
shared_preload_libraries = 'pg_stat_statements'
```Install development files (for building extensions)
```yml
- uses: ankane/setup-postgres@v1
with:
dev-files: true
```## Extra Steps
Run queries
```yml
- run: psql -d testdb -c 'SHOW server_version'
```## Related Actions
- [setup-mysql](https://github.com/ankane/setup-mysql)
- [setup-mariadb](https://github.com/ankane/setup-mariadb)
- [setup-mongodb](https://github.com/ankane/setup-mongodb)
- [setup-elasticsearch](https://github.com/ankane/setup-elasticsearch)
- [setup-opensearch](https://github.com/ankane/setup-opensearch)
- [setup-sqlserver](https://github.com/ankane/setup-sqlserver)## Contributing
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- [Report bugs](https://github.com/ankane/setup-postgres/issues)
- Fix bugs and [submit pull requests](https://github.com/ankane/setup-postgres/pulls)
- Write, clarify, or fix documentation
- Suggest or add new features