aboutsummaryrefslogtreecommitdiffstats
path: root/.travis.yml
blob: d813d0aac240915082fd949d540955ed4c450be6 (plain)
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
#
# Required environment variables in the travis config
#
# DOCKER_USERNAME
#
language: cpp

git:
  submodules: false

env:
  global:
    - QT_INSTALL_DIR=~/Qt
    - QT_VERSION=5.15.0
    - QTCREATOR_VERSION=4.12.4
    - QTEST_FUNCTION_TIMEOUT=9000000

cache:
  directories:
    - ${QT_INSTALL_DIR}
    - ~/.ccache

stages:
  - name: Build Qbs and and run autotests

jobs:
  include:
    - &build-on-macos
      stage: Build Qbs and and run autotests
      name: With Qbs on macOS (xcode 11.5)
      os: osx
      osx_image: xcode11.5
      addons:
        homebrew:
          packages:
            - capnp
            - ccache
            - grpc
            - icoutils
            - makensis
            - protobuf
            - python3
            - p7zip
          update: true
      env:
        # Address sanitizer slows autotests down too much.
        # We would hit the maximum build time on Travis.
        BUILD_OPTIONS="modules.qbsbuildconfig.enableAddressSanitizer:false modules.cpp.compilerWrapper:ccache modules.qbs.debugInformation:true"
        QMAKE_PATH=${QT_INSTALL_DIR}/${QT_VERSION}/clang_64/bin/qmake
        PATH="${QT_INSTALL_DIR}/Qt Creator.app/Contents/MacOS:${PATH}"
        QBS_BUILD_PROFILE=qt
      before_install:
        - ./scripts/install-qt.sh -d ${QT_INSTALL_DIR} --version ${QT_VERSION} qtbase qtdeclarative qttools qtscript qtscxml
        - ./scripts/install-qt.sh -d ${QT_INSTALL_DIR} --version ${QTCREATOR_VERSION} qtcreator
        # Hack to workaround the BinaryProbe bug - it prefers /usr/bin/python3 to the one found in PATH
        # Older macs, however, do not have python3 in /usr/bin
        - /usr/bin/python3 -m pip install --user beautifulsoup4 lxml || python3 -m pip install --user beautifulsoup4 lxml
      before_script:
        - ulimit -c unlimited -S       # enable core dumps
      script:
        - ccache -s
        - qbs setup-toolchains --detect
        - qbs setup-qt ${QMAKE_PATH} qt
        - qbs config profiles.qt.baseProfile xcode-macosx-x86_64
        - qbs config defaultProfile qt
        - qbs config --list profiles
        - scripts/build-qbs-with-qbs.sh
        - ccache -s
      # Find core dump and print traceback on failure
      after_failure:
        - |
          for f in $(find /cores -maxdepth 1 -name 'core.*' -print); do
            lldb --core $f --batch --one-line "bt"
          done;

    - &build-on-windows-with-docker
      stage: Build Qbs and and run autotests
      name: With Qbs on Windows with Docker (Visual Studio 2017)
      if: NOT branch =~ ^gerrit
      os: windows
      services: docker
      env:
        CLCACHE_DIR="${HOME}/.ccache"
      before-install:
        - curl -sLo "/c/Program Files/Docker/docker-compose.exe" https://github.com/docker/compose/releases/download/1.25.3/docker-compose-Windows-x86_64.exe
        - docker-compose pull windows
      before_script:
        - docker-compose run --rm windows clcache -s
      script:
        - >
          docker-compose run --rm windows qbs build
          -p dist
          qbs.buildVariant:release
          modules.cpp.compilerWrapper:clcache
          modules.qbsbuildconfig.enableBundledQt:true
          modules.qbsbuildconfig.enableProjectFileUpdates:true
          modules.qbsbuildconfig.enableUnitTests:true
          modules.cpp.treatWarningsAsErrors:true
          project.withDocumentation:true
          config:release-64 profile:qt64
          config:release profile:qt
      after_script:
        - docker-compose run --rm windows clcache -s