Skip to content

Commit

Permalink
azure pipelines:
Browse files Browse the repository at this point in the history
* fail on error
* align build name for pull requests more with travis builds
* include dash link on azure page
  • Loading branch information
jef-n committed Dec 5, 2019
1 parent 61903a7 commit 81a08fd
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 66 deletions.
121 changes: 57 additions & 64 deletions .ci/azure-pipelines/azure-pipelines.yml
Expand Up @@ -2,7 +2,7 @@ variables:
LR: release-3_10
LTR: release-3_4
CTEST_CUSTOM_TESTS_IGNORE: "ProcessingGdalAlgorithmsRasterTest;ProcessingGdalAlgorithmsVectorTest;ProcessingGrass7AlgorithmsImageryTest;ProcessingGrass7AlgorithmsRasterTest;ProcessingGrass7AlgorithmsVectorTest;ProcessingGuiTest;ProcessingOtbAlgorithmsTest;ProcessingQgisAlgorithmsTest;ProcessingQgisAlgorithmsTestPt2;ProcessingQgisAlgorithmsTestPt3;ProcessingQgisAlgorithmsTestPt4;ProcessingScriptUtilsTest;PyQgsAnnotation;PyQgsAppStartup;PyQgsAuthManagerOAuth2OWSTest;PyQgsAuthManagerPKIOWSTest;PyQgsAuthManagerPasswordOWSTest;PyQgsAuthManagerProxy;PyQgsAuthSettingsWidget;PyQgsAuxiliaryStorage;PyQgsBlockingNetworkRequest;PyQgsExifTools;PyQgsFileDownloader;PyQgsFileUtils;PyQgsGeometryTest;PyQgsImageCache;PyQgsImportIntoPostGIS;PyQgsLayoutAtlas;PyQgsLayoutLegend;PyQgsLayoutMap;PyQgsLayoutMapGrid;PyQgsMapLayer;PyQgsOGRProvider;PyQgsOGRProviderGpkg;PyQgsOGRProviderSqlite;PyQgsOfflineEditingWFS;PyQgsPalLabelingCanvas;PyQgsPalLabelingLayout;PyQgsPalLabelingPlacement;PyQgsPointDisplacementRenderer;PyQgsProject;PyQgsProviderConnectionGpkg;PyQgsProviderConnectionPostgres;PyQgsPythonProvider;PyQgsRasterFileWriter;PyQgsRasterLayer;PyQgsSelectiveMasking;PyQgsServerAccessControlWMSGetlegendgraphic;PyQgsServerApi;PyQgsServerCacheManager;PyQgsServerLocaleOverride;PyQgsServerSecurity;PyQgsServerSettings;PyQgsServerWMS;PyQgsServerWMSDimension;PyQgsServerWMSGetFeatureInfo;PyQgsServerWMSGetLegendGraphic;PyQgsServerWMSGetMap;PyQgsServerWMSGetPrint;PyQgsServerWMTS;PyQgsSettings;PyQgsShapefileProvider;PyQgsSpatialiteProvider;PyQgsSvgCache;PyQgsSymbolLayer;PyQgsTaskManager;PyQgsTextRenderer;PyQgsVectorFileWriter;PyQgsVectorLayer;PyQgsVectorLayerUtils;PyQgsVirtualLayerProvider;PyQgsWFSProviderGUI;PyQgsZipUtils;qgis_3drenderingtest;qgis_alignrastertest;qgis_banned_keywords;qgis_browsermodeltest;qgis_callouttest;qgis_compositionconvertertest;qgis_datadefinedsizelegendtest;qgis_diagramtest;qgis_doxygen_order;qgis_dxfexporttest;qgis_expressiontest;qgis_filedownloader;qgis_geometrycheckstest;qgis_geometrytest;qgis_geonodeconnectiontest;qgis_grassprovidertest7;qgis_labelingenginetest;qgis_layout3dmaptest;qgis_layouthtmltest;qgis_layoutlabeltest;qgis_layoutmapgridtest;qgis_layoutmaptest;qgis_layoutpicturetest;qgis_layoutscalebartest;qgis_layouttabletest;qgis_legendrenderertest;qgis_licenses;qgis_maprendererjobtest;qgis_maprotationtest;qgis_mapsettingsutilstest;qgis_mimedatautilstest;qgis_networkaccessmanagertest;qgis_openclutilstest;qgis_painteffecttest;qgis_pallabelingtest;qgis_processingtest;qgis_projecttest;qgis_qgisappclipboard;qgis_rasterlayersaveasdialog;qgis_shellcheck;qgis_sip_include;qgis_sip_uptodate;qgis_sipify;qgis_spelling;qgis_styletest;qgis_svgcachetest;qgis_taskmanagertest;qgis_valuerelationwidgetwrapper;qgis_vectorfilewritertest;qgis_wcsprovidertest;qgis_ziplayertest;qgis_arcgisrestutilstest;qgis_coordinatereferencesystemtest;qgis_imagecachetest;qgis_invertedpolygonrenderertest"
Agent.Source.Git.ShallowFetchDepth: 1
Agent.Source.Git.ShallowFetchDepth: 120

trigger:
branches:
Expand All @@ -22,7 +22,6 @@ jobs:
pool:
vmImage: vs2015-win2012r2
timeoutInMinutes: 360
continueOnError: true
strategy:
maxParallel: 4
matrix:
Expand All @@ -44,33 +43,72 @@ jobs:

steps:
- bash: |
echo "BUILD_SOURCEBRANCHNAME: ${BUILD_SOURCEBRANCHNAME}"
if [ "$BUILD_REASON" = "PullRequest" ]; then
branch=$SYSTEM_PULLREQUEST_TARGETBRANCH
pr=$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
else
branch=$BUILD_SOURCEBRANCHNAME
fi
echo "BRANCH: ${branch}"
echo "PR: ${pr}"
echo "LR: ${LR}"
echo "LTR: ${LTR}"
case "${BUILD_SOURCEBRANCHNAME}" in
case "${branch}" in
"${LTR}")
echo "##vso[task.setvariable variable=OSGEO4W_PKG]qgis-ltr-dev"
echo "##vso[task.setvariable variable=OSGEO4W_DEPS]qgis-ltr-dev-deps"
OSGEO4W_PKG=qgis-ltr-dev
OSGEO4W_DEPS=qgis-ltr-dev-deps
;;
"${LR}")
echo "##vso[task.setvariable variable=OSGEO4W_PKG]qgis-rel-dev"
echo "##vso[task.setvariable variable=OSGEO4W_DEPS]qgis-rel-dev-deps"
OSGEO4W_PKG=qgis-rel-dev
OSGEO4W_DEPS=qgis-rel-dev-deps
;;
*)
echo "##vso[task.setvariable variable=OSGEO4W_PKG]qgis-dev"
echo "##vso[task.setvariable variable=OSGEO4W_DEPS]qgis-dev-deps"
OSGEO4W_PKG=qgis-dev
OSGEO4W_DEPS=qgis-dev-deps
;;
esac
displayName: 'Get package name from branch'
target=Experimental
major=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_MAJOR "\([0-9]*\)")\s*$/\1/p' CMakeLists.txt)
minor=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_MINOR "\([0-9]*\)")\s*$/\1/p' CMakeLists.txt)
patch=$(sed -ne 's/^SET(CPACK_PACKAGE_VERSION_PATCH "\([0-9]*\)")\s*$/\1/p' CMakeLists.txt)
binary=$(curl --location-trusted https://download.osgeo.org/osgeo4w/$OSGEO4W_ARCH/release/qgis/$OSGEO4W_PKG/LATEST.sha | sed -e "s/:.*$//")
(( binary++ )) || true
version=$major.$minor.$patch
sha="${BUILD_SOURCEVERSION:0:10}"
if [ "$BUILD_REASON" = "PullRequest" ]; then
buildname="PR $pr / $branch ($BUILD_BUILDID) ($sha) ($OSGEO4W_PKG $target $OSGEO4W_ARCH)" # no colons allowed here
else
buildname="$OSGEO4W_PKG-$version-$sha-$target-VC14-$OSGEO4W_ARCH"
fi
url=$buildname
url=${url//(/%28}
url=${url//)/%29}
url=${url// /+}
url="https://cdash.orfeo-toolbox.org/index.php?project=QGIS&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercombine=and&filtercount=2&showfilters=1&filtercombine=and&field1=buildname&compare1=61&value1=$url&field2=site&compare2=61&value2=azure-pipelines"
echo "##vso[task.setvariable variable=TARGET]$target"
echo "##vso[task.setvariable variable=OSGEO4W_PKG]$OSGEO4W_PKG"
echo "##vso[task.setvariable variable=OSGEO4W_DEPS]$OSGEO4W_DEPS"
echo "##vso[task.setvariable variable=MAJOR]$major"
echo "##vso[task.setvariable variable=MINOR]$minor"
echo "##vso[task.setvariable variable=PATCH]$patch"
echo "##vso[task.setvariable variable=BINARY]$binary"
echo "##vso[task.setvariable variable=VERSION]$version"
echo "##vso[task.setvariable variable=BUILDNAME]$buildname"
echo "##vso[task.setvariable variable=DASHURL]$url"
displayName: 'Setup build variables'
- script: curl --output c:\setup-x86.exe https://cygwin.com/setup-x86.exe
env:
OSGEO4W_ARCH: $(OSGEO4W_ARCH)
displayName: 'Download cygwin Installer'

- script: curl --output c:\osgeo4w-setup.exe https://download.osgeo.org/osgeo4w/osgeo4w-setup-%OSGEO4W_ARCH%.exe
env:
OSGEO4W_ARCH: $(OSGEO4W_ARCH)
displayName: 'Download OSGeo4W Installer'

- script: curl --location-trusted --output c:\cmake.msi https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5-win64-x64.msi
Expand All @@ -81,8 +119,6 @@ jobs:

# - script: curl --location-trusted --output c:\depends.zip http://www.dependencywalker.com/depends22_%PLATFORM%.zip
# displayName: 'Download Dependency walker'
# env:
# PLATFORM: $(PLATFORM)

# Too large…
# - task: Cache@2
Expand All @@ -95,7 +131,7 @@ jobs:
# cygwin
# displayName: Cache cygwin

- powershell: ms-windows/osgeo4w/runasadmin.ps1 c:\setup-x86.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/temp/cygwin -P "bison,flex,poppler,doxygen,git,unzip"
- powershell: ms-windows/osgeo4w/runasadmin.ps1 c:\setup-x86.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/temp/cygwin -P "bison,flex,git,unzip"
displayName: 'Installing cygwin'

# Too large…
Expand All @@ -111,17 +147,11 @@ jobs:
# displayName: Cache OSGeo4W

- powershell: ms-windows/osgeo4w/runasadmin.ps1 c:\osgeo4w-setup.exe --autoaccept --advanced --arch $env:OSGEO4W_ARCH --quiet-mode --upgrade-also --root $env:OSGEO4W_ROOT --only-site -s http://download.osgeo.org/osgeo4w -l c:\temp\osgeo4w -P $env:OSGEO4W_DEPS -P python3-clcache
env:
OSGEO4W_ARCH: $(OSGEO4W_ARCH)
OSGEO4W_ROOT: $(OSGEO4W_ROOT)
OSGEO4W_DEPS: $(OSGEO4W_DEPS)
displayName: 'Installing OSGeo4W'

- script: |
rmdir /s /q c:\temp\cygwin
rmdir /s /q c:\temp\osgeo4w
env:
OSGEO4W_ROOT: $(OSGEO4W_ROOT)
displayName: 'Clear package caches'
- powershell: ms-windows/osgeo4w/runasadmin.ps1 msiexec.exe /X C:\Windows\Installer\146218.msi /qn /norestart /l*v c:\cmake-uninstall.log
Expand All @@ -132,28 +162,16 @@ jobs:

- script: c:\cygwin\bin\unzip -o c:\ninja.zip -d %OSGEO4W_ROOT%\bin
displayName: 'Extracting Ninja'
env:
OSGEO4W_ROOT: $(OSGEO4W_ROOT)

# - script: c:\cygwin\bin\unzip -o c:\depends.zip -d %OSGEO4W_ROOT%\bin
# displayName: 'Extracting Dependency Walker'
# env:
# OSGEO4W_ROOT: $(OSGEO4W_ROOT)

- script: |
PATH %OSGEO4W_ROOT%\bin;%ProgramFiles%\CMake\bin;%PATH%
cmake --version
ctest --version
ninja --version
displayName: 'Display tool versions'
env:
OSGEO4W_ROOT: $(OSGEO4W_ROOT)
- script: curl --location-trusted --output c:\LATEST.sha https://download.osgeo.org/osgeo4w/$(OSGEO4W_ARCH)/release/qgis/$(OSGEO4W_PKG)/LATEST.sha
displayName: 'Download LATEST.sha'
env:
OSGEO4W_ARCH: $(OSGEO4W_ARCH)
OSGEO4W_PKG: $(OSGEO4W_PKG)
# Too large…
# - task: Cache@2
Expand All @@ -171,28 +189,11 @@ jobs:
- script: |
echo on
PATH c:\cygwin\bin;%OSGEO4W_ROOT%\bin;%PATH%
sed -ne 's/^SET(CPACK_PACKAGE_VERSION_MAJOR "\([0-9]*\)")\s*$/set major=\1/p' CMakeLists.txt >version.cmd
sed -ne 's/^SET(CPACK_PACKAGE_VERSION_MINOR "\([0-9]*\)")\s*$/set minor=\1/p' CMakeLists.txt >>version.cmd
sed -ne 's/^SET(CPACK_PACKAGE_VERSION_PATCH "\([0-9]*\)")\s*$/set patch=\1/p' CMakeLists.txt >>version.cmd
sed -ne 's/^\([0-9]*\):.*$/set binary=\1/p' c:\latest.sha >>version.cmd
call version.cmd
del version.cmd
set /A binary=%binary%+1
cd ms-windows\osgeo4w
touch skippackage
set OSGEO4W_CXXFLAGS=/MD /MP /Od /D NDEBUG
package-nightly.cmd %major%.%minor%.%patch% %binary% %OSGEO4W_PKG% %OSGEO4W_ARCH% %REPO_COMMIT:~0,10% azure-pipelines
env:
OSGEO4W_ROOT: $(OSGEO4W_ROOT)
OSGEO4W_ARCH: $(OSGEO4W_ARCH)
OSGEO4W_PKG: $(OSGEO4W_PKG)
BUILD_NUMBER: $(Build.BuildId)
CTEST_CUSTOM_TESTS_IGNORE: $(CTEST_CUSTOM_TESTS_IGNORE)
REPO_COMMIT: $(Build.SourceVersion)
CLCACHE_DIR: $(CLCACHE_DIR)
TARGET: Experimental
CC: $(CC)
CXX: $(CXX)
@echo "##[section] %OSGEO4W_ARCH% results available at %DASHURL%"
package-nightly.cmd %VERSION% %BINARY% %OSGEO4W_PKG% %OSGEO4W_ARCH% %BUILD_SOURCEVERSION:~0,10% azure-pipelines
displayName: 'Building QGIS'
# - script: |
Expand All @@ -207,16 +208,13 @@ jobs:
# call %OSGEO4W_ROOT%\bin\py3_env.bat
# depends /c /f:1 /ot:c:\crssync.log output\bin\crssync.exe
# echo ##vso[task.uploadfile]c:\crssync.log
# env:
# OSGEO4W_ROOT: $(OSGEO4W_ROOT)
# OSGEO4W_PKG: $(OSGEO4W_PKG)
# OSGEO4W_ARCH: $(OSGEO4W_ARCH)
# displayName: 'Upload build log'

- task: PublishTestResults@2
inputs:
testResultsFormat: 'cTest'
testResultsFiles: 'ms-windows/osgeo4w/build-$(OSGEO4W_PKG)-$(OSGEO4W_ARCH)/Testing/*/Test.xml'
failTaskOnFailedTests: true
displayName: 'Publishing tests'

# - script: |
Expand All @@ -228,10 +226,5 @@ jobs:
# du -sc .
# rmdir /s /q ms-windows\osgeo4w\build-$(OSGEO4W_PKG)-$(OSGEO4W_ARCH)
# displayName: Clean before creating the caches
# env:
# OSGEO4W_ROOT: $(OSGEO4W_ROOT)
# OSGEO4W_ARCH: $(OSGEO4W_ARCH)
# OSGEO4W_PKG: $(OSGEO4W_PKG)
# CLCACHE_DIR: $(CLCACHE_DIR)

# vim: set nowrap :
3 changes: 2 additions & 1 deletion ms-windows/osgeo4w/package-nightly.cmd
Expand Up @@ -29,6 +29,7 @@ if "%ARCH%"=="" goto usage
if not "%SHA%"=="" set SHA=-%SHA%
if "%SITE%"=="" set SITE=qgis.org
if "%TARGET%"=="" set TARGET=Nightly
if "%BUILDNAME%"=="" set BUILDNAME=%PACKAGENAME%-%VERSION%%SHA%-%TARGET%-VC14-%ARCH%

set BUILDDIR=%CD%\build-%PACKAGENAME%-%ARCH%
if not exist "%BUILDDIR%" mkdir %BUILDDIR%
Expand Down Expand Up @@ -116,7 +117,7 @@ cmake -G "%CMAKEGEN%" ^
-D CMAKE_LINKER="%CMAKE_COMPILER_PATH:\=/%/link.exe" ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="%OSGEO4W_CXXFLAGS%" ^
-D CMAKE_PDB_OUTPUT_DIRECTORY_RELWITHDEBINFO=%BUILDDIR%\apps\%PACKAGENAME%\pdb ^
-D BUILDNAME="%PACKAGENAME%-%VERSION%%SHA%-%TARGET%-VC14-%ARCH%" ^
-D BUILDNAME="%BUILDNAME%" ^
-D SITE="%SITE%" ^
-D PEDANTIC=TRUE ^
-D WITH_QSPATIALITE=TRUE ^
Expand Down
3 changes: 2 additions & 1 deletion ms-windows/osgeo4w/package.cmd
Expand Up @@ -28,6 +28,7 @@ if "%PACKAGENAME%"=="" goto usage
if "%ARCH%"=="" goto usage
if not "%SHA%"=="" set SHA=-%SHA%
if "%SITE%"=="" set SITE=qgis.org
if "%BUILDNAME%=="" set BUILDNAME=%PACKAGENAME%-%VERSION%%SHA%-Release-VC14-%ARCH%

set BUILDDIR=%CD%\build-%PACKAGENAME%-%ARCH%
if not exist "%BUILDDIR%" mkdir %BUILDDIR%
Expand Down Expand Up @@ -119,7 +120,7 @@ cmake -G "%CMAKEGEN%" ^
-D CMAKE_PDB_OUTPUT_DIRECTORY_RELEASE=%BUILDDIR%\apps\%PACKAGENAME%\pdb ^
-D CMAKE_SHARED_LINKER_FLAGS_RELEASE="/INCREMENTAL:NO /DEBUG /OPT:REF /OPT:ICF" ^
-D CMAKE_MODULE_LINKER_FLAGS_RELEASE="/INCREMENTAL:NO /DEBUG /OPT:REF /OPT:ICF" ^
-D BUILDNAME="%PACKAGENAME%-%VERSION%%SHA%-Release-VC14-%ARCH%" ^
-D BUILDNAME="%BUILDNAME%" ^
-D SITE="%SITE%" ^
-D PEDANTIC=TRUE ^
-D WITH_QSPATIALITE=TRUE ^
Expand Down

0 comments on commit 81a08fd

Please sign in to comment.