File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 strategy :
1111 matrix :
1212 python-version : [3.6, 3.7, 3.8, 3.9]
13+ postgresql-version : [10, 11, 12, 13]
1314 steps :
1415 - uses : actions/checkout@v2
1516 - name : Set up Python ${{ matrix.python-version }}
@@ -23,11 +24,23 @@ jobs:
2324 key : ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
2425 restore-keys : |
2526 ${{ runner.os }}-pip-
27+ - name : Install PostgreSQL
28+ env :
29+ POSTGRESQL_VERSION : ${{ matrix.postgresql-version }}
30+ run : |
31+ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
32+ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
33+ sudo apt-get update
34+ sudo apt-get -y install "postgresql-$POSTGRESQL_VERSION"
2635 - name : Install dependencies
2736 run : |
2837 pip install -e '.[test]'
2938 - name : Run tests
39+ env :
40+ POSTGRESQL_VERSION : ${{ matrix.postgresql-version }}
3041 run : |
42+ export POSTGRESQL_PATH="/usr/lib/postgresql/$POSTGRESQL_VERSION/bin/postgres"
43+ export INITDB_PATH="/usr/lib/postgresql/$POSTGRESQL_VERSION/bin/initdb"
3144 pytest
3245 deploy :
3346 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 88 strategy :
99 matrix :
1010 python-version : [3.6, 3.7, 3.8, 3.9]
11+ postgresql-version : [10, 11, 12, 13]
1112 steps :
1213 - uses : actions/checkout@v2
1314 - name : Set up Python ${{ matrix.python-version }}
@@ -21,11 +22,23 @@ jobs:
2122 key : ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
2223 restore-keys : |
2324 ${{ runner.os }}-pip-
25+ - name : Install PostgreSQL
26+ env :
27+ POSTGRESQL_VERSION : ${{ matrix.postgresql-version }}
28+ run : |
29+ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
30+ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
31+ sudo apt-get update
32+ sudo apt-get -y install "postgresql-$POSTGRESQL_VERSION"
2433 - name : Install dependencies
2534 run : |
2635 pip install -e '.[test]'
2736 - name : Run tests
37+ env :
38+ POSTGRESQL_VERSION : ${{ matrix.postgresql-version }}
2839 run : |
40+ export POSTGRESQL_PATH="/usr/lib/postgresql/$POSTGRESQL_VERSION/bin/postgres"
41+ export INITDB_PATH="/usr/lib/postgresql/$POSTGRESQL_VERSION/bin/initdb"
2942 pytest
3043 - name : Check formatting
3144 run : black . --check
Original file line number Diff line number Diff line change 55from django .conf import settings
66from testing .postgresql import Postgresql
77
8- _POSTGRESQL = Postgresql ()
8+ postgres = os .environ .get ("POSTGRESQL_PATH" )
9+ initdb = os .environ .get ("INITDB_PATH" )
10+ _POSTGRESQL = Postgresql (postgres = postgres , initdb = initdb )
911
1012
1113@pytest .hookimpl (tryfirst = True )
You can’t perform that action at this time.
0 commit comments