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

git:
  submodules: false

env:
  global:
    - QT_INSTALL_DIR=~/Qt
    - QT_VERSION=5.12.6
    - QTCREATOR_VERSION=4.10.2

stages:
  - name: Build Qbs and and run autotests

jobs:
  include:
    - &build-on-bionic
      stage: Build Qbs and and run autotests
      name: With Qbs on Ubuntu bionic (linux_gcc64)
      env:
        BUILD_OPTIONS=modules.cpp.compilerWrapper:ccache
      services:
        - docker
      before_script:
        - docker-compose pull bionic
        - ccache -M 5G
        - ccache -s
      after_script:
        - ccache -s
      script:
        - docker-compose run bionic scripts/build-qbs-with-qbs.sh

    - <<: *build-on-bionic
      name: With QMake on Ubuntu bionic (linux_gcc64)
      env:
        BUILD_OPTIONS="CONFIG+=ccache"
      script:
        - docker-compose run bionic scripts/build-qbs-with-qmake.sh

    - <<: *build-on-bionic
      name: With Qbs on Ubuntu bionic (mingw32_w64)
      env:
        BUILD_OPTIONS="profile:qt-mingw32_w64 modules.cpp.compilerWrapper:ccache modules.cpp.treatWarningsAsErrors:true config:release"
      script:
        - docker-compose run bionic qbs build ${BUILD_OPTIONS}

    - <<: *build-on-bionic
      name: With Qbs on Ubuntu bionic (linux_clang64 & clang_tidy)
      env:
        BUILD_OPTIONS="profile:qt-clang_64 modules.cpp.compilerWrapper:ccache"
      services:
        - docker
      script:
        - docker-compose run --rm bionic scripts/run-analyzer.sh

    - <<: *build-on-bionic
      name: With Qbs and with Qt for Android
      before_install:
        - docker-compose pull bionic
        - docker-compose pull bionic-android-513
        - docker-compose pull bionic-android-514
      script:
        - docker-compose run bionic qbs build modules.cpp.compilerWrapper:ccache modules.qbsbuildconfig.enableBundledQt:true config:release
        - docker-compose run bionic-android-513 scripts/test-qt-for-android.sh release/install-root/usr/local/bin
        - docker-compose run bionic-android-514 scripts/test-qt-for-android.sh release/install-root/usr/local/bin

    - &build-on-macos
      stage: Build Qbs and and run autotests
      name: With Qbs on macOS (xcode 11.3)
      os: osx
      osx_image: xcode11.3
      addons:
        homebrew:
          packages:
            - ccache
            - grpc
            - icoutils
            - makensis
            - protobuf
            - 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"
        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
        - pip2 install --user beautifulsoup4 lxml
      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

    - <<: *build-on-macos
      name: With Qbs on macOS (xcode 10.3)
      osx_image: xcode10.3
      if: branch = master

    - <<: *build-on-macos
      name: With Qbs on macOS (xcode 9.4)
      osx_image: xcode9.4

    - &build-on-windows
      stage: Build Qbs and and run autotests
      name: With Qbs on Windows (Visual Studio 2017)
      os: windows
      env:
        # Need to build in release mode. Otherwise autotests would be too slow.
        BUILD_OPTIONS="config:release modules.cpp.compilerWrapper:clcache"
        QMAKE_PATH=${QT_INSTALL_DIR}/${QT_VERSION}/msvc2017_64/bin/qmake.exe
        PATH="${QT_INSTALL_DIR}/Tools/QtCreator/bin:/c/Python38:/c/Python39:/c/Python38/Scripts:/c/Python39/Scripts:${PATH}"
        WITH_DOCS=0
        QBS_BUILD_PROFILE=qt
        CLCACHE_DIR="${HOME}/.ccache"
      before_install:
        # Install Qbs and Qt
        - ./scripts/install-qt.sh -d ${QT_INSTALL_DIR} --version ${QT_VERSION} --toolchain win64_msvc2017_64 qtbase qtdeclarative qttools qtscript
        - ./scripts/install-qt.sh -d ${QT_INSTALL_DIR} --version ${QTCREATOR_VERSION} qtcreator
        - choco install python
        - pip install git+https://github.com/frerich/clcache.git@cae73d8255d78db8ba11e23c51fd2c9a89e7475b
      before_script:
        - clcache -s
      after_script:
        - clcache -s
      script:
        - qbs setup-toolchains --detect
        - qbs setup-qt ${QMAKE_PATH} qt
        - qbs config qt.baseProfile MSVC2017-x64
        - qbs config defaultProfile qt
        - scripts/build-qbs-with-qbs.sh

    - <<: *build-on-windows
      name: With Qbs on Windows (clang-cl)
      if: branch = master
      script:
        - qbs setup-toolchains --detect
        - qbs setup-qt ${QMAKE_PATH} qt
        - qbs config profiles.qt.baseProfile clang-cl-x86_64
        - qbs config defaultProfile qt
        - scripts/build-qbs-with-qbs.sh