This action sets up Postgres on any OS. It also creates the `runner` user
and configures trusted access without password.
steps:
- # Use preinstalled PostgreSQL
- - name: Start PostgreSQL on Ubuntu
- run: |
- sudo systemctl start postgresql
- pg_isready
- - name: Create user
- run: |
- echo 'localhost:*:test:runner:test' > ~/.pgpass
- chmod u=rw,go= ~/.pgpass
- sudo -u postgres psql --command="CREATE USER runner CREATEDB ENCRYPTED PASSWORD 'test'"
-
+ - uses: ankane/setup-postgres@v1
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
{[testenv]commands}
-dropdb --username=runner test
createdb --username=runner test
- {envpython} -m pytest -D postgres://runner:test@localhost/test
+ {envpython} -m pytest -D postgres://runner@localhost/test
dropdb --username=runner test
[testenv:{py27,py34,py35,py36,py37,py38,py39}-postgres-w32]