Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

azure-pipelines-windows.yml 6.3 KB

You have to be logged in to leave a comment. Sign In
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
  1. # Template for Windows steps in Azure Pipelines
  2. steps:
  3. # Cache vcpkg installed libraries
  4. # Currently, caches are immutable and can't be updated.
  5. # To rebuild the cache, you have to change the date in the key list
  6. - task: Cache@2
  7. inputs:
  8. key: $(Agent.OS) | vcpkg | 20200422
  9. path: $(VCPKG_INSTALLATION_ROOT)/installed/
  10. cacheHitVar: CACHE_VCPKG_RESTORED
  11. displayName: Cache vcpkg libraries
  12. - bash: |
  13. set -x -e
  14. # Update vcpkg and checkout specific tag
  15. cd ${VCPKG_INSTALLATION_ROOT}
  16. git fetch --tags
  17. git tag
  18. git checkout tags/2020.04
  19. # By default, vcpkg builds both release and debug configurations.
  20. # Set VCPKG_BUILD_TYPE to build release only to save half time
  21. echo 'set (VCPKG_BUILD_TYPE release)' >> ${VCPKG_INSTALLATION_ROOT}/triplets/${WIN_PLATFORM}.cmake
  22. cat ${VCPKG_INSTALLATION_ROOT}/triplets/${WIN_PLATFORM}.cmake
  23. # install libraries
  24. vcpkg install netcdf-c gdal pcre fftw3[core,threads] clapack openblas --triplet ${WIN_PLATFORM}
  25. displayName: Install dependencies via vcpkg
  26. env:
  27. WIN_PLATFORM: "x64-windows"
  28. condition: ne(variables['CACHE_VCPKG_RESTORED'], true)
  29. - bash: |
  30. # hook up user-wide integration
  31. vcpkg integrate install
  32. # list installed libraries
  33. vcpkg list
  34. # Executable files search for DLL files in the directories listed in the PATH environment variable.
  35. echo "##vso[task.prependpath]${VCPKG_INSTALLATION_ROOT}/installed/${WIN_PLATFORM}/bin"
  36. # Tools like gdal_translate, ogr2ogr are located in tools/gdal
  37. echo "##vso[task.prependpath]${VCPKG_INSTALLATION_ROOT}/installed/${WIN_PLATFORM}/tools/gdal"
  38. displayName: Configure vcpkg
  39. env:
  40. WIN_PLATFORM: "x64-windows"
  41. - bash: |
  42. set -x -e
  43. choco install ninja
  44. choco install ghostscript
  45. displayName: Install dependencies via chocolatey
  46. - bash: |
  47. set -x -e
  48. choco install pngquant
  49. pip install --user sphinx
  50. echo "##vso[task.prependpath]C:\\Users\\VssAdministrator\\AppData\\Roaming\\Python\\Python37\\Scripts"
  51. displayName: Install dependencies for documentation
  52. condition: eq(variables['BUILD_DOCS'], true)
  53. - bash: |
  54. set -x -e
  55. choco install graphicsmagick
  56. echo "##vso[task.prependpath]C:\\Program Files\\GraphicsMagick-1.3.32-Q8"
  57. choco install ffmpeg
  58. echo "##vso[task.prependpath]C:\\ProgramData\\chocolatey\\lib\\ffmpeg\\tools"
  59. displayName: Install dependencies for testing
  60. condition: eq(variables['TEST'], true)
  61. - bash: |
  62. echo "##vso[task.setvariable variable=INSTALLDIR]$BUILD_SOURCESDIRECTORY/gmt-install-dir"
  63. echo "##vso[task.setvariable variable=COASTLINEDIR]$BUILD_SOURCESDIRECTORY/coastline"
  64. displayName: Set install location and coastline location
  65. - bash: |
  66. echo "##vso[task.prependpath]$INSTALLDIR/bin"
  67. echo "##vso[task.prependpath]C:\\Program Files\\Git\\usr\\bin"
  68. displayName: Set PATH
  69. - task: Cache@2
  70. inputs:
  71. key: coastline | ci/download-coastlines.sh
  72. path: $(COASTLINEDIR)
  73. cacheHitVar: CACHE_COASTLINE_RESTORED
  74. displayName: Cache GSHHG and DCW data
  75. - bash: ci/download-coastlines.sh
  76. displayName: Download coastlines
  77. condition: ne(variables['CACHE_COASTLINE_RESTORED'], true)
  78. - bash: ci/config-gmt-windows.sh
  79. displayName: Configure GMT
  80. # Azure Pipelines cannot find Visual Studio correctly if Ninja is used.
  81. # Here, we need
  82. # 1. call the vcvars64.bat script
  83. # 2. define CMAKE_C_COMPILER
  84. - script: |
  85. mkdir build
  86. cd build
  87. call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
  88. cmake .. -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=%VCPKG_INSTALLATION_ROOT%\scripts\buildsystems\vcpkg.cmake -DCMAKE_C_COMPILER=cl.exe -DCMAKE_BUILD_TYPE=Release
  89. cmake --build .
  90. displayName: Compile GMT
  91. # Cache the ${HOME}/.gmt directory, for docs and testing
  92. - task: Cache@2
  93. inputs:
  94. key: cachedata | 20200820-3
  95. path: $(HOMEPATH)/.gmt
  96. cacheHitVar: CACHE_CACHEDATA_RESTORED
  97. displayName: Cache GMT remote data for testing
  98. - bash: |
  99. set -x -e
  100. cd build
  101. cmake --build . --target docs_depends
  102. cmake --build . --target optimize_images
  103. cmake --build . --target docs_html
  104. # if html.log isn't empty (i.e., sphinx raise warnings), return 1
  105. ! [ -s doc/rst/html.log ]
  106. cmake --build . --target docs_man
  107. # if man.log isn't empty (i.e., sphinx raise warnings), return 1
  108. ! [ -s doc/rst/man.log ]
  109. displayName: Build documentations
  110. condition: eq(variables['BUILD_DOCS'], true)
  111. - script: |
  112. cd build
  113. cmake --build . --target install
  114. displayName: Install GMT
  115. - script: |
  116. gmt --version
  117. bash %INSTALLDIR%/bin/gmt-config --all
  118. gmt defaults -Vd
  119. gmt pscoast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -P -Vd > test.ps
  120. gmt begin && gmt coast -R0/10/0/10 -JM6i -Ba -Ggray -ENG+p1p,blue -Vd && gmt end
  121. gmt grdimage @earth_relief_01d -JH10c -Baf -pdf map
  122. gmt earthtide -T2018-06-18T12:00:00 -Gsolid_tide_up.grd
  123. displayName: Check a few simple commands
  124. # Download remote files, if not already cached [Windows agents always fail]
  125. - bash: |
  126. set -x -e
  127. exit 1
  128. displayName: Download remote data
  129. condition: ne(variables['CACHE_CACHEDATA_RESTORED'], true)
  130. # Run the full tests, and rerun failed tests
  131. - bash: |
  132. set -x -e
  133. # disable MinGW's path conversion, see #1035.
  134. export MSYS_NO_PATHCONV=1
  135. cd build
  136. ctest ${CTEST_ARGS} || ctest ${CTEST_ARGS} --rerun-failed || ctest ${CTEST_ARGS} --rerun-failed
  137. displayName: Full tests
  138. env:
  139. CTEST_ARGS: "--output-on-failure --force-new-ctest-process -j4 --timeout 480"
  140. condition: eq(variables['TEST'], true)
  141. - script: |
  142. cd doc/examples
  143. call do_examples.bat
  144. displayName: Run DOS batch examples
  145. condition: eq(variables['TEST'], true)
  146. enabled: false
  147. # Publish the whole build directory for debugging purpose
  148. - task: CopyFiles@2
  149. inputs:
  150. contents: 'build/**/*'
  151. targetFolder: $(Build.ArtifactStagingDirectory)
  152. condition: failed()
  153. - task: PublishBuildArtifacts@1
  154. inputs:
  155. pathToPublish: $(Build.ArtifactStagingDirectory)
  156. artifactName: BuildDirectory-Windows
  157. displayName: Publish build directory
  158. condition: failed()
  159. - bash: |
  160. set -x -e
  161. cd build
  162. cmake --build . --target gmt_release
  163. cmake --build . --target gmt_release_tar
  164. # Don't use cpack here. Chocolatey also provides a cpack command.
  165. cmake --build . --target package
  166. cmake -E sha256sum gmt-*.tar.gz gmt-*.tar.xz gmt-*.exe
  167. displayName: Package GMT
  168. condition: eq(variables['PACKAGE'], true)
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...