Skip to content
Commits on Source (48)
#!/usr/bin/env bash
###########################################################################
# before_install.sh
# ---------------------
# Date : February 2017
# Copyright : (C) 2017 by Denis Rouzaud
# Email : denis.rouzaud@gmail.com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
pip install autopep8 nose2 mock termcolor
export PERL_MM_USE_DEFAULT=1
export PERL_EXTUTILS_AUTOINSTALL="--defaultdeps"
cpanm --notest App::Licensecheck
#!/usr/bin/env bash
###########################################################################
# before_script.sh
# ---------------------
# Date : February 2017
# Copyright : (C) 2017 by Denis Rouzaud
# Email : denis.rouzaud@gmail.com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
#!/usr/bin/env bash
###########################################################################
# install.sh
# ---------------------
# Date : February 2017
# Copyright : (C) 2017 by Denis Rouzaud
# Email : denis.rouzaud@gmail.com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
export CORES=2
mkdir build
pushd build || exit
cmake -DWITH_SERVER=ON -DUSE_CCACHE=OFF -DWITH_CORE=OFF -DWITH_APIDOC=ON -DWITH_ASTYLE=ON -DENABLE_TESTS=ON ..
popd || exit
#!/usr/bin/env bash
###########################################################################
# script.sh
# ---------------------
# Date : February 2017
# Copyright : (C) 2017 by Denis Rouzaud
# Email : denis.rouzaud@gmail.com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
set -e
pushd build
export CTEST_BUILD_DIR=${TRAVIS_BUILD_DIR}
export CTEST_BUILD_COMMAND="/usr/bin/make -j3 -i -k"
python3 "${TRAVIS_BUILD_DIR}/.ci/travis/scripts/ctest2travis.py" xvfb-run ctest -VV --output-on-failure -S "${TRAVIS_BUILD_DIR}/.ci/travis/travis.ctest"
popd
#!/usr/bin/env bash
###########################################################################
# before_install.sh
# ---------------------
# Date : March 2019
# Copyright : (C) 2019 by Denis Rouzaud
# Email : denis@opengis.ch
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
#!/usr/bin/env bash
###########################################################################
# before_install.sh
# ---------------------
# Date : March 2019
# Copyright : (C) 2019 by Denis Rouzaud
# Email : denis@opengis.ch
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
set -e
.ci/travis/scripts/echo_travis_var.sh
pushd .docker
echo "travis_fold:start:docker_build"
echo "${bold}Docker build deps${endbold}"
docker --version
docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_TAG}" -f ${DOCKER_BUILD_DEPS_FILE} .
echo "travis_fold:end:docker_build"
popd
#!/usr/bin/env bash
###########################################################################
# before_install.sh
# ---------------------
# Date : March 2019
# Copyright : (C) 2019 by Denis Rouzaud
# Email : denis@opengis.ch
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
#!/usr/bin/env bash
###########################################################################
# before_install.sh
# ---------------------
# Date : March 2019
# Copyright : (C) 2019 by Denis Rouzaud
# Email : denis@opengis.ch
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
set -e
mkdir -p "${CCACHE_DIR}"
# copy ccache dir within QGIS source so it can be accessed from docker
cp -r ${CCACHE_DIR} ${TRAVIS_BUILD_DIR}/.ccache_image_build
# building docker images
DIR=$(git rev-parse --show-toplevel)/.docker
pushd "${DIR}"
echo "${bold}Building QGIS Docker image '${DOCKER_TAG}'...${endbold}"
docker build --build-arg DOCKER_TAG="${DOCKER_TAG}" \
--cache-from "qgis/qgis:${DOCKER_TAG}" \
-t "qgis/qgis:${DOCKER_TAG}" \
-f qgis.dockerfile ..
echo "${bold}Pushing image to docker hub...${endbold}"
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
docker push "qgis/qgis:${DOCKER_TAG}"
echo "Copy build cache from Docker container to Travis cache directory"
rm -rf "${CCACHE_DIR:?}/"*
docker run --name qgis_container qgis/qgis:${DOCKER_TAG} /bin/true
docker cp qgis_container:/usr/src/.ccache_image_build ${CCACHE_DIR}
docker rm qgis_container
popd
echo "Trigger build of PyQGIS Documentation"
if [[ ${TRIGGER_PYQGIS_DOC} =~ ^TRUE$ ]]; then
body='{
"request": {
"branch":"master",
"message": "Trigger PyQGIS doc build after release of new Docker image as __DOCKER_TAG__",
"config": {
"merge_mode": "deep_merge",
"matrix": {
"include": {
"env": ["QGIS_VERSION_BRANCH=__QGIS_VERSION_BRANCH__"]
}
}
}
}
}'
body=$(sed "s/__QGIS_VERSION_BRANCH__/${TRAVIS_BRANCH}/; s/__DOCKER_TAG__/${DOCKER_TAG}/" <<< $body)
curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" \
-H "Travis-API-Version: 3" -H "Authorization: token $TRAVIS_TOKEN" -d "$body" \
https://api.travis-ci.org/repo/qgis%2Fpyqgis/requests
else
echo "skipped from configuration"
fi
#!/usr/bin/env bash
###########################################################################
# before_install.sh
# ---------------------
# Date : March 2016
# Copyright : (C) 2016 by Matthias Kuhn
# Email : matthias at opengis dot ch
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
#!/usr/bin/env bash
###########################################################################
# before_script.sh
# ---------------------
# Date : August 2015
# Copyright : (C) 2015 by Nyall Dawson
# Email : nyall dot dawson at gmail dot com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
set -e
DOCKER_DEPS_PUSH=$( [[ $TRAVIS_REPO_SLUG =~ qgis/QGIS ]] && [[ "${TRAVIS_EVENT_TYPE}" != "pull_request" ]] && echo "true" || echo "false" )
.ci/travis/scripts/echo_travis_var.sh
pushd .docker
echo "travis_fold:start:docker_build"
echo "${bold}Docker build deps${endbold}"
docker --version
docker-compose --version
docker-compose -f ${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml config
docker pull "qgis/qgis3-build-deps:${DOCKER_TAG}" || true
docker build --cache-from "qgis/qgis3-build-deps:${DOCKER_TAG}" -t "qgis/qgis3-build-deps:${DOCKER_TAG}" -f ${DOCKER_BUILD_DEPS_FILE} .
echo "travis_fold:end:docker_build"
echo "travis_fold:start:docker_push"
echo "${bold}Docker push deps${endbold}"
# image should be pushed even if QGIS build fails
# but push is achieved only on branches (not for PRs)
if [[ $DOCKER_DEPS_PUSH =~ true ]]; then
echo "push to qgis/qgis3-build-deps:${DOCKER_TAG}"
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
#docker tag "qgis/qgis3-build-deps:${DOCKER_TAG}" "qgis/qgis3-build-deps:latest"
docker push "qgis/qgis3-build-deps:${DOCKER_TAG}"
fi
echo "travis_fold:end:docker_push"
popd
# black list
PyQgsJsonUtils
PyQgsLocalServer
PyQgsPalLabelingServer
qgis_composermapgridtest
qgis_composerutils
PyQgsAppStartup
# code layout tests are run on separate build
qgis_spelling
qgis_sipify
qgis_sip_include
qgis_sip_uptodate
# flaky
qgis_filedownloader
qgis_openstreetmaptest
qgis_wcsprovidertest
PyQgsWFSProviderGUI
qgis_ziplayertest
# Flaky, see https://dash.orfeo-toolbox.org/testDetails.php?test=63061783&build=297405
PyQgsSpatialiteProvider
# Flaky, the ms odbc driver crashes a lot on the ubuntu docker image. Retest when
# the docker base image is upgraded
PyQgsMssqlProvider
# Need a local postgres installation
PyQgsAuthManagerPKIPostgresTest
PyQgsAuthManagerPasswordPostgresTest
PyQgsAuthManagerOgrPostgresTest
PyQgsDbManagerPostgis
# Needs an OpenCL device, the library is not enough
qgis_openclutilstest
#!/usr/bin/env bash
set -e
##############
# Setup ccache
##############
export CCACHE_TEMPDIR=/tmp
ccache -M 1G
# Temporarily uncomment to debug ccache issues
# export CCACHE_LOGFILE=/tmp/cache.debug
ccache -z
############################
# Setup the (c)test environment
############################
export LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so
export SEGFAULT_SIGNALS="abrt segv"
export CTEST_BUILD_COMMAND="/usr/bin/ninja"
export CTEST_PARALLEL_LEVEL=1
##############################
# Variables for output styling
##############################
bold=$(tput bold)
endbold=$(tput sgr0)
###########
# Configure
###########
pushd /root/QGIS > /dev/null
mkdir -p build
pushd build > /dev/null
echo "travis_fold:start:cmake"
echo "${bold}Running cmake...${endbold}"
cmake \
-GNinja \
-DUSE_CCACHE=OFF \
-DWITH_QUICK=ON \
-DWITH_3D=ON \
-DWITH_STAGED_PLUGINS=ON \
-DWITH_GRASS=OFF \
-DSUPPRESS_QT_WARNINGS=ON \
-DENABLE_MODELTEST=ON \
-DENABLE_PGTEST=ON \
-DENABLE_MSSQLTEST=ON \
-DWITH_QSPATIALITE=ON \
-DWITH_QWTPOLAR=OFF \
-DWITH_APIDOC=OFF \
-DWITH_ASTYLE=OFF \
-DWITH_DESKTOP=ON \
-DWITH_BINDINGS=ON \
-DWITH_SERVER=ON \
-DDISABLE_DEPRECATED=ON \
-DPYTHON_TEST_WRAPPER="timeout -sSIGSEGV 55s"\
-DCXX_EXTRA_FLAGS="${CLANG_WARNINGS}" \
-DWERROR=TRUE \
-DQT5_3DEXTRA_LIBRARY="/usr/lib/x86_64-linux-gnu/libQt53DExtras.so" \
-DQT5_3DEXTRA_INCLUDE_DIR="/root/QGIS/external/qt3dextra-headers" \
-DCMAKE_PREFIX_PATH="/root/QGIS/external/qt3dextra-headers/cmake" \
..
echo "travis_fold:end:cmake"
#######
# Build
#######
# Calculate the timeout for building.
# The tests should be aborted before travis times out, in order to allow uploading
# the ccache and therefore speedup subsequent e builds.
#
# Travis will kill the job after approx 150 minutes, we subtract 5 minutes for
# uploading and subtract the bootstrapping time from that.
# Hopefully clocks are in sync :)
TRAVIS_TIME=150
UPLOAD_TIME=5
CURRENT_TIME=$(date +%s)
TIMEOUT=$((( TRAVIS_TIME - UPLOAD_TIME ) * 60 - CURRENT_TIME + TRAVIS_TIMESTAMP))
TIMEOUT=$(( TIMEOUT < 300 ? 300 : TIMEOUT ))
echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"
# echo "travis_fold:start:ninja-build.1"
echo "${bold}Building QGIS...${endbold}"
timeout ${TIMEOUT}s ${CTEST_BUILD_COMMAND}
# echo "travis_fold:end:ninja-build.1"
rv=$?
if [ $rv -eq 124 ] ; then
printf '\n\n${bold}Build and test timeout. Please restart the build for meaningful results.${endbold}\n'
exit #$rv
fi
# Temporarily uncomment to debug ccache issues
# echo "travis_fold:start:ccache-debug"
# cat /tmp/cache.debug
# echo "travis_fold:end:ccache-debug"
############################
# Restore postgres test data
############################
printf "[qgis_test]\nhost=postgres\nport=5432\ndbname=qgis_test\nuser=docker\npassword=docker" > ~/.pg_service.conf
export PGUSER=docker
export PGHOST=postgres
export PGPASSWORD=docker
export PGDATABASE=qgis_test
pushd /root/QGIS > /dev/null
/root/QGIS/tests/testdata/provider/testdata_pg.sh
popd > /dev/null # /root/QGIS
##############################
# Restore SQL Server test data
##############################
echo "Importing SQL Server test data..."
export SQLUSER=sa
export SQLHOST=mssql
export SQLPORT=1433
export SQLPASSWORD='<YourStrong!Passw0rd>'
export SQLDATABASE=qgis_test
export PATH=$PATH:/opt/mssql-tools/bin
pushd /root/QGIS > /dev/null
/root/QGIS/tests/testdata/provider/testdata_mssql.sh
popd > /dev/null # /root/QGIS
echo "Setting up DSN for test SQL Server"
cat <<EOT > /etc/odbc.ini
[ODBC Data Sources]
testsqlserver = ODBC Driver 17 for SQL Server
[testsqlserver]
Driver = ODBC Driver 17 for SQL Server
Description = Test SQL Server
Server = mssql
EOT
###########
# Run tests
###########
CURRENT_TIME=$(date +%s)
TIMEOUT=$((( TRAVIS_TIME - UPLOAD_TIME) * 60 - CURRENT_TIME + TRAVIS_TIMESTAMP))
echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"
timeout ${TIMEOUT}s python3 /root/QGIS/.ci/travis/scripts/ctest2travis.py xvfb-run ctest -V -E "$(cat /root/QGIS/.ci/travis/linux/blacklist.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)" -S /root/QGIS/.ci/travis/travis.ctest --output-on-failure
rv=$?
if [ $rv -eq 124 ] ; then
printf '\n\n${bold}Build and test timeout. Please restart the build for meaningful results.${endbold}\n'
exit #$rv
fi
########################
# Show ccache statistics
########################
echo "travis_fold:start:ccache.stats"
echo "ccache statistics"
ccache -s
echo "travis_fold:end:ccache.stats"
popd > /dev/null # build
popd > /dev/null # /root/QGIS
[ -r /tmp/ctest-important.log ] && cat /tmp/ctest-important.log || true
#!/usr/bin/env bash
###########################################################################
# install.sh
# ---------------------
# Date : March 2016
# Copyright : (C) 2016 by Matthias Kuhn
# Email : matthias at opengis dot ch
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
shopt -s expand_aliases
alias python=python3
#!/usr/bin/env bash
###########################################################################
# script.sh
# ---------------------
# Date : March 2016
# Copyright : (C) 2016 by Matthias Kuhn
# Email : matthias at opengis dot ch
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
set -e
# running QGIS tests
docker-compose -f ${TRAVIS_BUILD_DIR}/.docker/docker-compose.travis.yml run --rm qgis-deps
#!/usr/bin/env bash
ccache -s
#!/usr/bin/env bash
###########################################################################
# before_install.sh
# ---------------------
# Date : August 2015
# Copyright : (C) 2015 by Nyall Dawson
# Email : nyall dot dawson at gmail dot com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
date +%s > /tmp/travis_timestamp
brew tap osgeo/osgeo4mac
brew update
brew install python3
pip3 install \
numpy \
psycopg2 \
numpy \
nose2 \
pyyaml \
mock \
future \
termcolor \
oauthlib
brew install \
qscintilla2 \
qt \
qt5-webkit \
qca \
qwtpolar \
gsl \
sqlite \
expat \
proj \
gdal2-python --with-python3 \
spawn-fcgi \
lighttpd \
poppler \
bison \
expat \
bison \
flex \
ninja \
ccache \
spatialindex \
fastcgi \
qtkeychain \
gnu-sed \
libzip
mkdir -p "${HOME}/Library/Python/3.6/lib/python/site-packages"
echo 'import site; site.addsitedir("/usr/local/opt/gdal2-python/lib/python3.6/site-packages")' >> "${HOME}/Library/Python/3.6/lib/python/site-packages/gdal2.pth"
# layout tests are run on separate build
qgis_spelling
qgis_sipify
qgis_sip_uptodate
qgis_openstreetmaptest
qgis_wcsprovidertest
PyQgsServer
PyQgsOfflineEditingWFS
ProcessingGdalAlgorithmsTest
ProcessingGrass7AlgorithmsImageryTest
ProcessingGrass7AlgorithmsRasterTest
qgis_composerhtmltest
PyQgsOfflineEditingWFS
qgis_authconfigtest
qgis_atlascompositiontest
qgis_composerlabeltest
qgis_composerrotationtest
qgis_composerscalebartest
qgis_composerutilstest
qgis_composertablev2test
qgis_diagramtest
qgis_fontmarkertest
qgis_labelingenginetest
qgis_legendrenderertest
qgis_maprotationtest
qgis_composerhtmltest
qgis_mapcanvastest
qgis_filedownloader
PyQgsAnnotation
PyQgsAtlasComposition
PyQgsComposerLegend
PyQgsComposerMapGrid
PyQgsDistanceArea
PyQgsPalLabelingBase
PyQgsPalLabelingPlacement
PyQgsPalLabelingComposer
ProcessingQgisAlgorithmsTest
qgis_composermapgridtest
qgis_composerpicturetest
qgis_taskmanagertest
PyQgsPalLabelingCanvas
PyQgsTextRenderer
PyQgsSpatialiteProvider
PyQgsSymbolLayer
PyQgsVectorFileWriter
PyQgsVirtualLayerProvider
PyQgsWFSProvider
PyQgsWFSProviderGUI
PyQgsLayerDependencies
PyQgsDBManagerGpkg
PyQgsFileDownloader
PyQgsSettings
PyQgsConsole
PyQgsLocator
PyQgsAuthManagerPasswordOWSTest
#!/usr/bin/env bash
###########################################################################
# install.sh
# ---------------------
# Date : August 2015
# Copyright : (C) 2015 by Nyall Dawson
# Email : nyall dot dawson at gmail dot com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
mkdir build
pushd build || exit
export PATH=/usr/local/opt/ccache/libexec:$PATH
HB=$(brew --prefix)
# force looking in HB/opt paths first, so headers in HB/include are not found first
prefixes="qt5
qt5-webkit
qscintilla2
qwt
qwtpolar
qca
qtkeychain
gdal2
gsl
geos
proj
libspatialite
spatialindex
fcgi
expat
sqlite
flex
bison
libzip"
full_prefixes=""
for p in ${prefixes}; do
full_prefixes+="${HB}/opt/${p};"
done
#no PGTEST for OSX - can't get postgres to start with brew install
#no APIDOC for OSX - doxygen tests and warnings are covered by linux build
#no deprecated-declarations warnings... requires QGIS ported to Cocoa
cmake \
-G 'Ninja' \
-DCMAKE_FIND_FRAMEWORK:STRING=LAST \
-DCMAKE_PREFIX_PATH:STRING="${full_prefixes}" \
-DWITH_SERVER=OFF \
-DWITH_DESKTOP=OFF \
-DWITH_STAGED_PLUGINS=ON \
-DENABLE_MODELTEST=ON \
-DENABLE_PGTEST=OFF \
-DWITH_QWTPOLAR=OFF \
-DCMAKE_CXX_FLAGS="-Wno-deprecated-declarations" \
..
popd || exit
#!/usr/bin/env bash
###########################################################################
# script.sh
# ---------------------
# Date : August 2015
# Copyright : (C) 2015 by Nyall Dawson
# Email : nyall dot dawson at gmail dot com
###########################################################################
# #
# This program is free software; you can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License, or #
# (at your option) any later version. #
# #
###########################################################################
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
echo "$PATH"
export PATH=/usr/bin:${PATH}
ccache -M 500M
ccache -z
# Calculate the timeout for the tests.
# The tests should be aborted before travis times out, in order to allow uploading
# the ccache and therefore speedup subsequent e builds.
#
# Travis will kill the job after approx 48 minutes, we subtract 8 minutes for
# uploading and initialization (40) and subtract the bootstrapping time from that.
TIMEOUT=$((40 * 60 - $(date +%s) + $(cat /tmp/travis_timestamp)))
export CTEST_BUILD_COMMAND=/usr/local/bin/ninja
export CTEST_BUILD_DIR=${TRAVIS_BUILD_DIR}
gtimeout "${TIMEOUT}s" ctest -V -E "$(cat "${DIR}"/blacklist.txt | gsed -r '/^(#.*?)?$/d' | gpaste -sd '|' -)" -S "${DIR}/../travis.ctest" --output-on-failure
rv=$?
if [ $rv -eq 124 ] ; then
printf '\n\n\033[0;33mBuild and test timeout. Please restart the build for meaningful results.\033[0m\n'
fi
exit $rv