Skip to content

Commit

Permalink
Use official postgis docker image in CI (#355)
Browse files Browse the repository at this point in the history
* Use official postgis docker image in CI

Drop unsupported GitHub action:
https://github.com/huaxk/postgis-action/releases

* Drop possibly not needed configuration

* Set up pg password

* Unify env var names

* Bring back extensions

* Revert "Unify env var names"

This reverts commit 007520a.

* Update changelog

* One more drop
  • Loading branch information
amureki committed Oct 17, 2022
1 parent b90253b commit cc08b58
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
23 changes: 14 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,30 @@ jobs:
name: Python ${{ matrix.python-version }}
runs-on: ubuntu-latest

services:
postgis:
image: postgis/postgis
env:
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

env:
PGPASSWORD: postgres
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11-dev"]

steps:
- uses: actions/checkout@v3

- name: Setup PostgreSQL with PostGIS
uses: huaxk/postgis-action@v1
with:
postgresql version: '11'
postgresql db: 'postgres'
postgresql user: 'postgres'

- name: Install PostgreSQL dependencies
- name: Set up PostgreSQL
run: |
sudo apt-get update
sudo apt-get install -y gdal-bin
psql -c "CREATE ROLE runner SUPERUSER LOGIN CREATEDB;" -U postgres -h localhost -p 5432
psql template1 -c "CREATE EXTENSION citext;" -U postgres -h localhost -p 5432
psql template1 -c "CREATE EXTENSION hstore;" -U postgres -h localhost -p 5432
psql template1 -c "CREATE EXTENSION postgis;" -U postgres -h localhost -p 5432
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Changed
- Fixed a bug with `seq` being passed a tz-aware start value [PR #353](https://github.com/model-bakers/model_bakery/pull/353)
- [dev] Use official postgis docker image in CI [PR #355](https://github.com/model-bakers/model_bakery/pull/355)

### Removed

Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ setenv =
PYTHONPATH={toxinidir}
postgresql: TEST_DB=postgis
postgresql: PGUSER=postgres
postgresql: PGPASSWORD=postgres
sqlite: TEST_DB=sqlite
sqlite: USE_TZ=True
deps =
Expand Down

0 comments on commit cc08b58

Please sign in to comment.