@@ -216,33 +216,75 @@ jobs:
216216 - uses : ./.github/actions/ubuntu-prerequisites
217217 - uses : ./.github/actions/build-and-test
218218
219- windows-2019 :
220- runs-on : windows-2019
219+ windows :
220+ strategy :
221+ matrix :
222+ os : [windows-2019, windows-2022]
223+ runs-on : ${{ matrix.os }}
221224 env :
222225 GETOPT_INCLUDE_DIR : ${{ github.workspace }}/../wingetopt/src
223226 GETOPT_LIBRARY : ${{ github.workspace }}/../wingetopt/build/Release/wingetopt.lib
227+ VCPKG_DEFAULT_BINARY_CACHE : C:/vcpkg_binary_cache
224228 steps :
225229 - uses : actions/checkout@v2
230+ - uses : actions/cache@v2
226231 with :
227- submodules : true
232+ path : |
233+ C:/vcpkg_binary_cache
234+ key : vcpkg-binary-cache-${{ matrix.os }}
235+ - uses : actions/cache@v2
236+ with :
237+ path : |
238+ C:/postgis.zip
239+ key : postgis-cache
240+ - name : Prepare cache
241+ run : if [ ! -d C:/vcpkg_binary_cache ]; then mkdir C:/vcpkg_binary_cache; fi
242+ shell : bash
243+ - uses : ./.github/actions/win-postgres
228244 - uses : ./.github/actions/win-install
229245 - uses : ./.github/actions/win-getopt
230246 - uses : ./.github/actions/win-cmake
231247 - uses : ./.github/actions/win-build
232248 - uses : ./.github/actions/win-test
249+ - name : Package osm2pgsql
250+ run : |
251+ mkdir c:/artifact/
252+ mkdir c:/artifact/osm2pgsql-bin
253+ cp -r Release/* ../README.md ../COPYING ../*.style ../scripts ../flex-config c:/artifact/osm2pgsql-bin/
254+ shell : bash
255+ working-directory : build
256+ if : matrix.os == 'windows-2022'
257+ - name : ' Upload Artifact'
258+ uses : actions/upload-artifact@v2
259+ with :
260+ name : osm2pgsql-win64
261+ path : c:/artifact
262+ if : matrix.os == 'windows-2022'
233263
234- windows-2022 :
264+ windows-package :
265+ needs : windows
235266 runs-on : windows-2022
236267 env :
237- GETOPT_INCLUDE_DIR : ${{ github.workspace }}/../wingetopt/src
238- GETOPT_LIBRARY : ${{ github.workspace }}/../wingetopt/build/Release/wingetopt.lib
268+ OSMURL : https://download.geofabrik.de/europe/monaco-latest.osm.bz2
239269 steps :
240270 - uses : actions/checkout@v2
271+ - uses : actions/cache@v2
241272 with :
242- submodules : true
243- - uses : ./.github/actions/win-install
244- - uses : ./.github/actions/win-getopt
245- - uses : ./.github/actions/win-cmake
246- - uses : ./.github/actions/win-build
247- - uses : ./.github/actions/win-test
273+ path : |
274+ C:/postgis.zip
275+ key : postgis-cache
276+ - uses : actions/download-artifact@v2
277+ with :
278+ name : osm2pgsql-win64
279+ - uses : ./.github/actions/win-postgres
280+ - name : Set up database
281+ run : |
282+ & $env:PGBIN\createdb osm
283+ & $env:PGBIN\psql -d osm -c "CREATE EXTENSION hstore; CREATE EXTENSION postgis;"
284+ shell : pwsh
285+ - name : Get test data
286+ run : (new-object net.webclient).DownloadFile($env:OSMURL, "testfile.osm.bz2")
287+ - name : Exceute osm2pgsql
288+ run : ./osm2pgsql-bin/osm2pgsql --slim -d osm testfile.osm.bz2
289+ shell : bash
248290
0 commit comments