7070 # The NPGSQL_TEST_POSTGIS environment variable ensures that if PostGIS isn't installed,
7171 # the PostGIS tests fail and therefore fail the build.
7272 env :
73- NPGSQL_TEST_POSTGIS : ${{ !startsWith(matrix.os, 'windows') && !startsWith(matrix.os, 'macos') }}
73+ NPGSQL_TEST_POSTGIS : ${{ !startsWith(matrix.os, 'windows') && !startsWith(matrix.os, 'macos') && matrix.pg_prerelease == '' }}
7474
7575 steps :
7676 - name : Checkout
@@ -108,16 +108,19 @@ jobs:
108108 sudo chmod 600 $PGDATA/{server.crt,server.key,ca.crt}
109109 sudo chown postgres $PGDATA/{server.crt,server.key,ca.crt}
110110
111+ # Create the npgsql_tests database
112+ sudo -u postgres psql -c "CREATE DATABASE npgsql_tests"
113+
111114 # Create npgsql_tests user with md5 password 'npgsql_tests'
112115 sudo -u postgres psql -c "CREATE USER npgsql_tests SUPERUSER PASSWORD 'md5adf74603a5772843f53e812f03dacb02'"
113116
114117 sudo -u postgres psql -c "CREATE USER npgsql_tests_ssl SUPERUSER PASSWORD 'npgsql_tests_ssl'"
115118 sudo -u postgres psql -c "CREATE USER npgsql_tests_nossl SUPERUSER PASSWORD 'npgsql_tests_nossl'"
116119
117- # To disable PostGIS for prereleases (because it usually isn't available until late), surround with the following:
118- # if [ -z "${{ matrix.pg_prerelease }}" ]; then
120+ # Install PostGIS if required
121+ if [[ $NPGSQL_TEST_POSTGIS == 'true' ] ]; then
119122 sudo apt-get install -qq postgresql-${{ matrix.pg_major }}-postgis-${{ env.postgis_version }}
120- # fi
123+ fi
121124
122125 if [ ${{ matrix.pg_major }} -ge 14 ]; then
123126 sudo sed -i "s|unix_socket_directories = '/var/run/postgresql'|unix_socket_directories = '/var/run/postgresql, @/npgsql_unix'|" $PGDATA/postgresql.conf
@@ -192,6 +195,9 @@ jobs:
192195 sed -i "s|#max_prepared_transactions = 0|max_prepared_transactions = 100|" pgsql/PGDATA/postgresql.conf
193196 pgsql/bin/pg_ctl -D pgsql/PGDATA -l logfile -o '-c ssl=true -c ssl_cert_file=../server.crt -c ssl_key_file=../server.key -c ssl_ca_file=../ca.crt' start
194197
198+ # Create npgsql_tests database
199+ pgsql/bin/psql -U postgres -c "CREATE DATABASE npgsql_tests"
200+
195201 # Create npgsql_tests user with md5 password 'npgsql_tests'
196202 pgsql/bin/psql -U postgres -c "CREATE ROLE npgsql_tests SUPERUSER LOGIN PASSWORD 'md5adf74603a5772843f53e812f03dacb02'"
197203
@@ -256,6 +262,9 @@ jobs:
256262 sleep 5
257263 done
258264
265+ # Create the npgsql_tests database
266+ psql -c "CREATE DATABASE npgsql_tests" postgres
267+
259268 # Create npgsql_tests user with md5 password 'npgsql_tests'
260269 psql -c "CREATE USER npgsql_tests SUPERUSER PASSWORD 'md5adf74603a5772843f53e812f03dacb02'" postgres
261270
@@ -298,11 +307,8 @@ jobs:
298307 done
299308 psql -c "CREATE USER npgsql_tests_scram SUPERUSER PASSWORD 'npgsql_tests_scram'" postgres
300309
301- # TODO: Once test/Npgsql.Specification.Tests work, switch to just testing on the solution
302310 - name : Test
303- run : |
304- dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} test/Npgsql.Tests --logger "GitHubActions;report-warnings=false" --blame-crash --blame-hang-timeout 30s
305- dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} test/Npgsql.DependencyInjection.Tests --logger "GitHubActions;report-warnings=false"
311+ run : dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} --logger "GitHubActions;report-warnings=false" --blame-crash --blame-hang-timeout 30s
306312 shell : bash
307313
308314 - name : Upload Test Hang Dumps
@@ -314,13 +320,6 @@ jobs:
314320 **/*.dmp
315321 **/*_Sequence.xml
316322
317- - name : Test Plugins
318- run : |
319- if [ -z "${{ matrix.pg_prerelease }}" ]; then
320- dotnet test -c ${{ matrix.config }} -f ${{ matrix.test_tfm }} test/Npgsql.PluginTests --logger "GitHubActions;report-warnings=false"
321- fi
322- shell : bash
323-
324323 - id : analyze_tag
325324 name : Analyze tag
326325 shell : bash
0 commit comments