summaryrefslogtreecommitdiff
path: root/circle.yml
blob: 4b7ca2735c11b984be89468f127cc74acbad8316 (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
156
157
158
159
160
161
162
163
version: 2.1

workflows:
  version: 2
  default:
    jobs:
      - build-template-linux:
          name: Android armeabi-v7a Release
          config_params: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a'
      - build-template-linux:
          name: Android arm64-v8a Release
          config_params: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a'
      - build-template-linux:
          name: Android x86 Release
          config_params: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86'
      - build-template-linux:
          name: Android x86_64 Release
          config_params: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64'
      - build-template-linux:
          name: Linux GCC4.9 Release
          config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-4.9 -DCMAKE_CXX_COMPILER=g++-4.9'
          build_params: '--target mbgl-core'
          test_params: '-N'
      - build-template-linux:
          name: Linux GCC8 Release
          config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8'
      - build-template-linux:
          name: Linux GCC8 Debug Coverage
          config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_BUILD_TYPE=DebugCoverage'
      - build-template-linux:
          name: Linux Clang8 Sanitize Address
          config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_BUILD_TYPE=Sanitize -DMBGL_WITH_SANITIZER=address'
      - build-template-linux:
          name: Linux Clang8 Sanitize Thread
          config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_BUILD_TYPE=Sanitize -DMBGL_WITH_SANITIZER=thread'
      - build-template-linux:
          name: Linux Clang8 Sanitize Memory
          config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_BUILD_TYPE=Sanitize -DMBGL_WITH_SANITIZER=memory'
      - build-template-linux:
          name: Linux Clang8 Sanitize Undefined
          config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_BUILD_TYPE=Sanitize -DMBGL_WITH_SANITIZER=undefined'
      - build-template-linux:
          name: Qt5 Linux GCC5 Release
          config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-5 -DCMAKE_CXX_COMPILER=g++-5 -DMBGL_WITH_QT=ON'
          build_params: '--target mbgl-qt'
          test_params: '-N'

commands:
  prepare:
    steps:
      - run:
          name: Prepare
          command: |
            git submodule update --init --recursive
            npm install
  config:
    parameters:
      config_params:
        type: string
    steps:
      - run:
          name: Configure
          command: |
            mkdir build && cd build
            cmake .. << parameters.config_params >>
  build:
    parameters:
      build_params:
        type: string
    steps:
      - run:
          name: Build
          command: |
            cd build
            cmake --build . -j 4 << parameters.build_params >>
  test:
    parameters:
      test_params:
        type: string
    steps:
      - run:
          name: Test
          command: |
            cd build
            xvfb-run ctest -V << parameters.test_params >>

executors:
  linux:
    docker:
      # FIXME: Move the image to mbgl/
      - image: tmpsantos/mbgl_ci:1.2
    resource_class: large
    working_directory: /src

jobs:
  build-template-linux:
    environment:
      ASAN_OPTIONS: ASAN_OPTIONS=fast_unwind_on_malloc=0:detect_leaks=1:color=always:print_summary=1
    parameters:
      config_params:
        type: string
        default: '-G Ninja'
      build_params:
        type: string
        default: ''
      test_params:
        type: string
        default: ''
    executor: linux
    steps:
      - checkout
      - prepare
      - config:
          config_params: << parameters.config_params >>
      - build:
          build_params: << parameters.build_params >>
      - test:
          test_params: << parameters.test_params >>
      - store_artifacts:
          path: /src/mapbox-gl-js/test/integration/render-tests
          destination: render-tests
          when: on_fail

#      - build-template-macos:
#          name: Qt5 macOS xcode 10.1.0 Release
#          xcode: '10.1.0'
#          config_params: '-G Xcode -DMBGL_WITH_QT=ON'
#      - build-template-macos:
#          name: macOS xcode 10.2.1 Release
#          xcode: '10.2.1'
#          config_params: '-G Xcode'
#  build-template-macos:
#    parameters:
#      xcode:
#        type: string
#      config_params:
#        type: string
#        default: ''
#      build_params:
#        type: string
#        default: ''
#    macos:
#      xcode: << parameters.xcode >>
#    environment:
#      HOMEBREW_NO_AUTO_UPDATE: 1
#      HOMEBREW_NO_INSTALL_CLEANUP: 1
#    steps:
#      - checkout
#      - prepare
#      - run:
#          name: Install deps
#          command: |
#            brew install cmake ccache pkgconfig glfw qt
#            brew link qt --force
#            export HOMEBREW_QT5_CELLAR=$(brew --cellar qt)
#            export HOMEBREW_QT5_VERSION=$(brew list --versions qt |rev |cut -d' ' -f1 |rev)
#            sudo ln -s $HOMEBREW_QT5_CELLAR/$HOMEBREW_QT5_VERSION/mkspecs /usr/local/mkspecs
#            sudo ln -s $HOMEBREW_QT5_CELLAR/$HOMEBREW_QT5_VERSION/plugins /usr/local/plugins
#      - config:
#          config_params: << parameters.config_params >>
#      - build:
#          build_params: << parameters.build_params >>
#      - test