aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/scripts/ci/appveyor.yml72
-rwxr-xr-xsrc/scripts/ci_build.py15
2 files changed, 27 insertions, 60 deletions
diff --git a/src/scripts/ci/appveyor.yml b/src/scripts/ci/appveyor.yml
index eef1e758c..b6df94a6f 100644
--- a/src/scripts/ci/appveyor.yml
+++ b/src/scripts/ci/appveyor.yml
@@ -1,79 +1,56 @@
-# Let's call MSVS 2015 the default compiler, 64 bit the default architecture,
+# Let's call MSVS 2017 the default compiler, 64 bit the default architecture,
# release the default configuration and --enable-shared the default mode.
#
# Build jobs
# 1. six basic builds: 32/64bit on MSVS2013/2015/2017
-# 2. add static lib and amalgamation
-# 3. add a debug build on MSVS2013/2015
+# 2. add static lib, amalgamation and debug on MSVC2017
#
# Note: Avoid the AppVeyor settings `platform` and `configuration` since excluding
# from the build matrix is not supported (https://github.com/appveyor/ci/issues/386)
+clone_depth: 5
+
environment:
matrix:
# 1
- MSVS: 2013
PLATFORM: x86
- CONFIG:
- MODE:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- MSVS: 2013
PLATFORM: x86_amd64
- CONFIG:
- MODE:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- MSVS: 2015
PLATFORM: x86
- CONFIG:
- MODE:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- MSVS: 2015
PLATFORM: x86_amd64
- CONFIG:
- MODE:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- MSVS: 2017
PLATFORM: x86
- CONFIG:
- MODE:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- MSVS: 2017
PLATFORM: x86_amd64
- CONFIG:
- MODE:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+
# 2
- - MSVS:
- PLATFORM:
- CONFIG:
- MODE: --disable-shared
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- - MSVS:
- PLATFORM:
- CONFIG:
- MODE: --amalgamation
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+ - MSVS: 2017
+ PLATFORM: x86_amd64
+ CONFIG: --disable-shared
+ APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+ - MSVS: 2017
+ PLATFORM: x86_amd64
+ CONFIG: --amalgamation
+ APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
+
# 3
- - MSVS: 2013
- PLATFORM:
- CONFIG: Debug
- MODE:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- - MSVS: 2015
- PLATFORM:
- CONFIG: Debug
- MODE:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
+ - MSVS: 2017
+ PLATFORM: x86_amd64
+ CONFIG: --with-debug
+ APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
install:
- # Set defaults
- - if [%MSVS%] == [] set MSVS=2015
- - if [%PLATFORM%] == [] set PLATFORM=x86_amd64
- - if [%CONFIG%] == [] set CONFIG=Release
- - if [%MODE%] == [] set MODE=--enable-shared
-
# Check setup
- - echo Current build setup MSVS="%MSVS%" PLATFORM="%PLATFORM%" CONFIG="%CONFIG%" MODE="%MODE%"
+ - echo Current build setup MSVS="%MSVS%" PLATFORM="%PLATFORM%" CONFIG="%CONFIG%"
# Choose compiler
- if %MSVS% == 2013 (
@@ -86,18 +63,12 @@ install:
call "%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %PLATFORM%
)
- cl # check compiler version
-
- appveyor DownloadFile http://download.qt.io/official_releases/jom/jom.zip -FileName jom.zip
- 7z e jom.zip
build_script:
- - if %CONFIG% == Release (
- python configure.py --cc=msvc --cpu=%PLATFORM% %MODE%
- )
- - if %CONFIG% == Debug (
- python configure.py --cc=msvc --cpu=%PLATFORM% %MODE% --debug-mode
- )
- - jom -j2
+ - python configure.py --cc=msvc --cpu=%PLATFORM% %CONFIG%
+ - jom -j3
- botan-test
- nmake install
@@ -105,3 +76,4 @@ build_script:
branches:
only:
- master
+ - release-2
diff --git a/src/scripts/ci_build.py b/src/scripts/ci_build.py
index 182799145..bbb2b6c06 100755
--- a/src/scripts/ci_build.py
+++ b/src/scripts/ci_build.py
@@ -25,15 +25,6 @@ def get_concurrency():
except ImportError:
return def_concurrency
-def getenv_or_die(var):
- """
- Like it says...
- """
- val = os.getenv(var)
- if val is None:
- raise Exception('Required variable %s not set in environment' % (var))
- return val
-
def determine_flags(target, target_os, target_cc, cc_bin, use_ccache, root_dir):
# pylint: disable=too-many-branches,too-many-statements,too-many-arguments
@@ -110,7 +101,7 @@ def determine_flags(target, target_os, target_cc, cc_bin, use_ccache, root_dir):
'--out-dir', 'bw-outputs']
test_cmd = ['sonar-scanner',
'-Dproject.settings=%s' % (os.path.join(root_dir, 'src', 'build-data', 'sonar-project.properties')),
- '-Dsonar.login=%s' % (getenv_or_die('SONAR_TOKEN'))]
+ '-Dsonar.login=%s' % (os.getenv('SONAR_TOKEN'))]
if is_cross_target:
if target_os == 'ios':
@@ -283,6 +274,10 @@ def main(args=None):
target = args[1]
+ if target == 'sonar' and os.getenv('SONAR_TOKEN') is None:
+ print('Skipping Sonar scan due to missing SONAR_TOKEN env variable')
+ return 0
+
root_dir = options.root_dir
if os.access(root_dir, os.R_OK) != True: