-
-
Notifications
You must be signed in to change notification settings - Fork 96
119 lines (111 loc) · 5.57 KB
/
build-windows.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Build MapCache on Windows
on: [ push, pull_request ]
jobs:
build-matrix:
strategy:
matrix:
os: [ windows-2019 ]
option: [ default ]
runs-on: ${{matrix.os}}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install dependencies
run: |
Set-Location -Path "${{github.workspace}}"
New-Item -Path . -Name "sdk" -ItemType "directory"
Set-Location -Path "sdk"
curl -O https://download.gisinternals.com/sdk/downloads/release-1928-x64-dev.zip
unzip -qq release-1928-x64-dev.zip
$sdkprefix = "${{github.workspace}}\sdk\release-1928-x64"
Set-Location -Path "$sdkprefix\lib"
Copy-Item -Path "libfcgi.lib" -Destination "fcgi.lib"
Copy-Item -Path "apr-1.lib" -Destination "apr-1-1.lib"
Copy-Item -Path "libapr-1.lib" -Destination "apr-1.lib"
Copy-Item -Path "aprutil-1.lib" -Destination "aprutil-1-1.lib"
Copy-Item -Path "libaprutil-1.lib" -Destination "aprutil-1.lib"
- name: Build MapCache
run: |
$sdkprefix = "${{github.workspace}}\sdk\release-1928-x64"
Set-Location -Path "${{github.workspace}}"
New-Item -Path . -Name "build" -ItemType "directory"
Set-Location -Path "build"
cmake -DCMAKE_PREFIX_PATH="$sdkprefix" -DWITH_APACHE=OFF -DWITH_FCGI=ON -DWITH_PCRE=ON -DWITH_TIFF=OFF "${{github.workspace}}"
cmake --build . --config Release
Copy-Item -Destination "$sdkprefix\bin" -Path "Release\mapcache.dll", "cgi\Release\mapcache.fcgi.exe", "util\Release\mapcache_seed.exe", "contrib\mapcache_detail\Release\mapcache_detail.exe"
Set-Location -Path "$sdkprefix\bin"
Compress-Archive -DestinationPath "${{github.workspace}}\mapcache.zip" -Path "${{github.workspace}}\mapcache.xml", "mapcache.dll", "mapcache.fcgi.exe", "mapcache_seed.exe", "mapcache_detail.exe"
- name: Upload binary artifacts
uses: actions/upload-artifact@v2
with:
name: binaries
path: mapcache.zip
retention-days: 15
- name: Setup tests
run: |
$sdkprefix = "${{github.workspace}}\sdk\release-1928-x64"
Set-Location -Path "${{github.workspace}}\build"
Copy-Item -Path "..\tests\data\world.tif" -Destination .
New-Item -Path "mapcache.xml"
Set-Content -Path "mapcache.xml" -Value @"
<?xml version=`"1.0`" encoding=`"UTF-8`"?>
<mapcache>
<source name=`"global-tif`" type=`"gdal`">
<data>${{github.workspace}}\build\world.tif</data>
</source>
<cache name=`"disk`" type=`"disk`">
<base>${{github.workspace}}\build</base>
</cache>
<tileset name=`"global`">
<cache>disk</cache>
<source>global-tif</source>
<grid maxzoom=`"17`">GoogleMapsCompatible</grid>
<format>JPEG</format>
<metatile>1 1</metatile>
</tileset>
<locker type=`"disk`">
<directory>${{github.workspace}}\build</directory>
</locker>
<service type=`"wms`" enabled=`"true`"/>
<service type=`"wmts`" enabled=`"true`"/>
<log_level>debug</log_level>
</mapcache>
"@
- name: Run tests
run: |
$sdkprefix = "${{github.workspace}}\sdk\release-1928-x64"
Set-Location -Path "$sdkprefix\bin"
$env:GDAL_DATA = "$sdkprefix\bin\gdal-data"
$env:PROJ_LIB = "$sdkprefix\bin\proj9\share"
.\mapcache_seed.exe -c "${{github.workspace}}\build\mapcache.xml" -t global --force -z 0,1
Copy-Item -Path "${{github.workspace}}\build\global\GoogleMapsCompatible\00\000\000\000\000\000\000.jpg" -Destination "${{github.workspace}}\seed.jpg"
.\gdal\apps\gdalinfo.exe -checksum "${{github.workspace}}\seed.jpg"
$match = (.\gdal\apps\gdalinfo.exe -checksum "${{github.workspace}}\seed.jpg" | Select-String -CaseSensitive -Pattern "Checksum=21411" -Quiet)
if ( $match ) {
"Success: matched checksum for seed.jpg"
} else {
"Failure: Did not get expected checksum for seed.jpg"
exit 1
}
$env:MAPCACHE_CONFIG_FILE = "${{github.workspace}}\build\mapcache.xml"
$env:REQUEST_METHOD = "GET"
$env:PATH_INFO = "/wmts/1.0.0/global/default/GoogleMapsCompatible/0/0/0.jpg"
$env:QUERY_STRING = ""
Start-Process -FilePath ".\mapcache.fcgi.exe" -RedirectStandardOutput "${{github.workspace}}\fcgi.jpg" -NoNewWindow -Wait
perl.exe -0777 -pi -e 'binmode ARGV;binmode ARGVOUT;s/[A-Z][a-z][-:; ,\/=A-Za-z0-9\r\n]*//' "${{github.workspace}}\fcgi.jpg"
.\gdal\apps\gdalinfo.exe -checksum "${{github.workspace}}\fcgi.jpg"
$match = (.\gdal\apps\gdalinfo.exe -checksum "${{github.workspace}}\fcgi.jpg" | Select-String -CaseSensitive -Pattern "Checksum=21411" -Quiet)
if ( $match ) {
"Success: matched checksum for fcgi.jpg"
} else {
"Failure: Did not get expected checksum for fcgi.jpg"
exit 1
}
- name: Upload test artifacts
uses: actions/upload-artifact@v2
with:
name: test-results
path: |
seed.jpg
fcgi.jpg
retention-days: 2