From: Oleg Broytman Date: Fri, 10 Sep 2021 15:18:58 +0000 (+0300) Subject: CI(GHActions): Setup PostgreSQL using `ankane/setup-postgres@v1` X-Git-Tag: 0.3.0~4^2~2 X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=95f0ca216dff246dbcefd897ecef8f63ef297680;p=sqlconvert.git CI(GHActions): Setup PostgreSQL using `ankane/setup-postgres@v1` This action sets up Postgres on any OS. It also creates the `runner` user and configures trusted access without password. --- diff --git a/.github/workflows/run-tests.yaml b/.github/workflows/run-tests.yaml index cd07729..0f928d2 100644 --- a/.github/workflows/run-tests.yaml +++ b/.github/workflows/run-tests.yaml @@ -14,17 +14,7 @@ jobs: 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: diff --git a/tox.ini b/tox.ini index 3d9cf96..fa79032 100644 --- a/tox.ini +++ b/tox.ini @@ -58,7 +58,7 @@ commands = {[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]