|
37 | 37 | is_release: ${{ steps.analyze_tag.outputs.is_release }} |
38 | 38 | is_prerelease: ${{ steps.analyze_tag.outputs.is_prerelease }} |
39 | 39 |
|
| 40 | + # Installing PostGIS on Windows is complicated/unreliable, so we don't test on it. |
| 41 | + # The NPGSQL_TEST_POSTGIS environment variable ensures that if PostGIS isn't installed, |
| 42 | + # the PostGIS tests fail and therefore fail the build. |
| 43 | + env: |
| 44 | + NPGSQL_TEST_POSTGIS: ${{ !startsWith(matrix.os, 'windows') }} |
| 45 | + |
40 | 46 | steps: |
41 | 47 | - name: Checkout |
42 | 48 | uses: actions/checkout@v5 |
|
89 | 95 | # Match Npgsql CI Docker image and stash one level up |
90 | 96 | cp $GITHUB_WORKSPACE/.build/{server.crt,server.key} pgsql |
91 | 97 |
|
92 | | - # Find OSGEO version number |
93 | | - OSGEO_VERSION=$(\ |
94 | | - curl -Ls https://download.osgeo.org/postgis/windows/pg${{ matrix.pg_major }} | |
95 | | - sed -n 's/.*>postgis-bundle-pg${{ matrix.pg_major }}-\(${{ env.postgis_version }}.[0-9]*.[0-9]*\)x64.zip<.*/\1/p' | |
96 | | - tail -n 1) |
97 | | - if [ -z "$OSGEO_VERSION" ]; then |
98 | | - OSGEO_VERSION=$(\ |
99 | | - curl -Ls https://download.osgeo.org/postgis/windows/pg${{ matrix.pg_major }}/archive | |
100 | | - sed -n 's/.*>postgis-bundle-pg${{ matrix.pg_major }}-\(${{ env.postgis_version }}.[0-9]*.[0-9]*\)x64.zip<.*/\1/p' | |
101 | | - tail -n 1) |
102 | | - POSTGIS_PATH="archive/" |
103 | | - else |
104 | | - POSTGIS_PATH="" |
105 | | - fi |
106 | | -
|
107 | | - # Install PostGIS |
108 | | - echo "Installing PostGIS (version: ${OSGEO_VERSION})" |
109 | | - POSTGIS_FILE="postgis-bundle-pg${{ matrix.pg_major }}-${OSGEO_VERSION}x64" |
110 | | - curl -o postgis.zip -L https://download.osgeo.org/postgis/windows/pg${{ matrix.pg_major }}/${POSTGIS_FILE}.zip |
111 | | - unzip postgis.zip -d postgis |
112 | | - cp -a postgis/$POSTGIS_FILE/. pgsql/ |
113 | | -
|
114 | 98 | # Start PostgreSQL |
115 | 99 | pgsql/bin/initdb -D pgsql/PGDATA -E UTF8 -U postgres |
116 | 100 | pgsql/bin/pg_ctl -D pgsql/PGDATA -l logfile -o '-c max_connections=200 -c max_prepared_transactions=10 -c ssl=true -c ssl_cert_file=../server.crt -c ssl_key_file=../server.key' start |
|
0 commit comments