summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.clang-format23
-rw-r--r--.clang-tidy3
-rw-r--r--.cmake-format91
-rw-r--r--appveyor.yml66
-rw-r--r--circle.yml311
-rw-r--r--scripts/ci/Dockerfile110
-rw-r--r--scripts/ci/etc/apt/sources.list10
7 files changed, 554 insertions, 60 deletions
diff --git a/.clang-format b/.clang-format
index ff0f39e73b..cacdf25308 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,18 +1,9 @@
-Standard: Cpp11
-IndentWidth: 4
+---
+Language: Cpp
+BasedOnStyle: Google
AccessModifierOffset: -4
-UseTab: Never
-BinPackParameters: false
-AllowShortIfStatementsOnASingleLine: false
-AllowShortLoopsOnASingleLine: false
-AllowShortBlocksOnASingleLine: false
-AllowShortFunctionsOnASingleLine: false
-ConstructorInitializerAllOnOneLineOrOnePerLine: true
-AlwaysBreakTemplateDeclarations: true
-NamespaceIndentation: None
-PointerBindsToType: true
-SpacesInParentheses: false
-BreakBeforeBraces: Attach
-ColumnLimit: 100
-Cpp11BracedListStyle: false
+AllowShortFunctionsOnASingleLine: Inline
+ColumnLimit: 120
+IndentWidth: 4
SpacesBeforeTrailingComments: 1
+...
diff --git a/.clang-tidy b/.clang-tidy
index 97600637ed..e8a74962be 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,3 +1,4 @@
-Checks: 'modernize-*,misc-static-assert,llvm-namespace-comment,-clang-analyzer-security.insecureAPI.rand,-clang-analyzer-core.uninitialized.UndefReturn,-clang-analyzer-core.StackAddressEscape,-clang-analyzer-core.CallAndMessage,-clang-diagnostic-unused-command-line-argument,-clang-analyzer-core.uninitialized.*,-clang-analyzer-core.NullDereference,-clang-analyzer-core.NonNullParamChecker'
+Checks: 'bugprone-*,clang-analyzer-*,cppcoreguidelines-*,google-*,misc-*,modernize-*,performance-*,readability-*,-cppcoreguidelines-avoid-magic-numbers,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-special-member-functions,-google-readability-todo,-google-runtime-int,-misc-non-private-member-variables-in-classes,-readability-magic-numbers,-readability-named-parameter'
WarningsAsErrors: '*'
+HeaderFilterRegex: '.*'
FormatStyle: file
diff --git a/.cmake-format b/.cmake-format
new file mode 100644
index 0000000000..abd1e46cb8
--- /dev/null
+++ b/.cmake-format
@@ -0,0 +1,91 @@
+
+# --------------------------
+# General Formatting Options
+# --------------------------
+# How wide to allow formatted cmake files
+line_width = 140
+
+# How many spaces to tab for indent
+tab_size = 4
+
+# If arglists are longer than this, break them always
+max_subargs_per_line = 3
+
+# If true, separate flow control names from their parentheses with a space
+separate_ctrl_name_with_space = False
+
+# If true, separate function names from parentheses with a space
+separate_fn_name_with_space = False
+
+# If a statement is wrapped to more than one line, than dangle the closing
+# parenthesis on it's own line
+dangle_parens = True
+
+# If the statement spelling length (including space and parenthesis is larger
+# than the tab width by more than this amoung, then force reject un-nested
+# layouts.
+max_prefix_chars = 2
+
+# If a candidate layout is wrapped horizontally but it exceeds this many lines,
+# then reject the layout.
+max_lines_hwrap = 8
+
+# What style line endings to use in the output.
+line_ending = u'unix'
+
+# Format command names consistently as 'lower' or 'upper' case
+command_case = u'canonical'
+
+# Format keywords consistently as 'lower' or 'upper' case
+keyword_case = u'unchanged'
+
+# Specify structure for custom cmake functions
+additional_commands = {
+ "add_node_module": {
+ "kwargs": {
+ "INSTALL_PATH": "*",
+ "NAN_VERSION": "*",
+ "EXCLUDE_NODE_ABIS": "*"
+ }
+ },
+ "target_compile_definitions": {
+ "kwargs": {
+ "PRIVATE": "*",
+ "PUBLIC": "*"
+ }
+ },
+ "target_sources": {
+ "kwargs": {
+ "INTERFACE": "*",
+ "PRIVATE": "*",
+ "PUBLIC": "*"
+ }
+ }
+}
+
+# A list of command names which should always be wrapped
+always_wrap = [
+ "add_executable",
+ "add_library",
+ "set_source_files_properties",
+ "target_compile_definitions",
+ "target_include_directories",
+ "target_link_libraries",
+ "target_sources"
+]
+
+# Specify the order of wrapping algorithms during successive reflow attempts
+algorithm_order = [0, 1, 2, 3, 4]
+
+# If true, the argument lists which are known to be sortable will be sorted
+# lexicographicall
+enable_sort = True
+
+# If true, the parsers may infer whether or not an argument list is sortable
+# (without annotation).
+autosort = True
+
+# If a comment line starts with at least this many consecutive hash characters,
+# then don't lstrip() them off. This allows for lazy hash rulers where the first
+# hash char is not separated by space
+hashruler_min_length = 10
diff --git a/appveyor.yml b/appveyor.yml
index 0e1bd01124..2440c3f601 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -5,29 +5,15 @@ image:
- Visual Studio 2017
environment:
- PYTHON: C:\python37
+ PYTHON: C:\python37
matrix:
- configuration: Release
-
-clone_depth: 1
-
-after_build:
- - mkdir qmapboxgl
- - mkdir qmapboxgl\lib
- - mkdir qmapboxgl\include
- - copy qmapboxgl.dll qmapboxgl\lib
- - copy qmapboxgl.exp qmapboxgl\lib
- - copy qmapboxgl.lib qmapboxgl\lib
- - copy %APPVEYOR_BUILD_FOLDER%\platform\qt\include\* qmapboxgl\include
- - 7z a qmapboxgl-%APPVEYOR_REPO_COMMIT%.zip qmapboxgl
-
-artifacts:
- - path: build\qmapboxgl-%APPVEYOR_REPO_COMMIT%.zip
- name: QMapboxGL
+ - configuration: Debug
test: off
+clone_depth: 1
for:
-
@@ -36,10 +22,10 @@ for:
- image: Visual Studio 2015
environment:
- LLVM_VERSION: 5.0.1
- LLVM_HASH: 981543611D719624ACB29A2CFFD6A479CFF36E8AB5EE8A57D8ECA4F9C4C6956F
- VCVARSALL: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat'
- QT_PREFIX: 'C:\Qt\latest\msvc2015_64\lib\cmake'
+ LLVM_VERSION: 5.0.1
+ LLVM_HASH: 981543611D719624ACB29A2CFFD6A479CFF36E8AB5EE8A57D8ECA4F9C4C6956F
+ VCVARSALL: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat'
+ QT_PREFIX: 'C:\Qt\latest\msvc2015_64\lib\cmake'
-
matrix:
@@ -53,52 +39,52 @@ for:
QT_PREFIX: 'C:\Qt\latest\msvc2017_64\lib\cmake'
cache:
- - '%APPVEYOR_BUILD_FOLDER%\mason_packages'
+ - '%APPVEYOR_BUILD_FOLDER%\.git\modules'
- '%APPVEYOR_BUILD_FOLDER%\LLVM-%LLVM_VERSION%-win64.exe'
- '%APPVEYOR_BUILD_FOLDER%\cmake-3.10.1-win64-x64.zip'
- C:\clcache
install:
+ - set PATH=%PYTHON%\Scripts;%PYTHON%;%PATH%
+ - pip install clcache
- git config --system core.longpaths true
- git submodule sync
- git submodule update --init
- git submodule foreach git submodule update --init
- ps: |
- if (!(Test-Path cmake-3.10.1-win64-x64.zip)) {
- appveyor DownloadFile https://cmake.org/files/v3.10/cmake-3.10.1-win64-x64.zip
- }
- scripts\check-sha256.ps1 cmake-3.10.1-win64-x64.zip 8251F70C85B58F3CA1F24E4A3B0637E2D609B5E4A341D00B70E02E89244D5029
- Start-Process -FilePath '7z' -ArgumentList 'x','cmake-3.10.1-win64-x64.zip','-oC:\' -Wait
- - ps: |
if (!(Test-Path "LLVM-$env:LLVM_VERSION-win64.exe")) {
appveyor DownloadFile "https://releases.llvm.org/$env:LLVM_VERSION/LLVM-$env:LLVM_VERSION-win64.exe"
}
scripts\check-sha256.ps1 LLVM-$env:LLVM_VERSION-win64.exe "$env:LLVM_HASH"
Start-Process -FilePath "LLVM-$env:LLVM_VERSION-win64.exe" -ArgumentList '/S',"/D=C:\LLVM-$env:LLVM_VERSION" -Wait
- - set PATH=%PYTHON%\Scripts;%PYTHON%;%PATH%
- - pip install clcache
+ - ps: |
+ if (!(Test-Path cmake-3.10.1-win64-x64.zip)) {
+ appveyor DownloadFile https://cmake.org/files/v3.10/cmake-3.10.1-win64-x64.zip
+ }
+ scripts\check-sha256.ps1 cmake-3.10.1-win64-x64.zip 8251F70C85B58F3CA1F24E4A3B0637E2D609B5E4A341D00B70E02E89244D5029
+ Start-Process -FilePath '7z' -ArgumentList 'x','cmake-3.10.1-win64-x64.zip','-oC:\' -Wait
before_build:
- set PATH=C:\LLVM-%LLVM_VERSION%\bin;%PATH%
- set PATH=C:\cmake-3.10.1-win64-x64\bin;%PATH%
- set CLCACHE_DIR=c:\clcache
- set CLCACHE_CL=clang-cl
+ - clcache -z
- set CC=clcache
- set CXX=clcache
+ - set CTEST_OUTPUT_ON_FAILURE=1
- mkdir %APPVEYOR_BUILD_FOLDER%\build
- cd %APPVEYOR_BUILD_FOLDER%\build
build_script:
- call "%VCVARSALL%" amd64
+ - cmake -E remove ../next/vendor
+ - cmake -E copy_directory ../vendor ../next/vendor
- cmake -G "Ninja"
- -DMBGL_PLATFORM=qt
- -DWITH_QT_DECODERS=ON
- -DWITH_QT_I18N=ON
- -DWITH_NODEJS=OFF
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_PREFIX_PATH=%QT_PREFIX%
- -DCMAKE_MAKE_PROGRAM="%APPVEYOR_BUILD_FOLDER%\platform\qt\ninja.exe"
- ..
- - clcache -z
- - cmake --build . -- -j %NUMBER_OF_PROCESSORS%
+ -DCMAKE_BUILD_TYPE=%CONFIGURATION%
+ -DCMAKE_MAKE_PROGRAM="%APPVEYOR_BUILD_FOLDER%\platform\qt\ninja.exe"
+ -DCMAKE_PREFIX_PATH=%QT_PREFIX%
+ -DMBGL_WITH_QT=ON
+ ../next
+ - cmake --build . --target qmapboxgl -- -j %NUMBER_OF_PROCESSORS%
- clcache -s
diff --git a/circle.yml b/circle.yml
index 453aab85ac..61c4b03654 100644
--- a/circle.yml
+++ b/circle.yml
@@ -2,7 +2,133 @@ version: 2.1
workflows:
version: 2
- default:
+ mbgl-next:
+ jobs:
+ - next-sanity-checks
+ - next-build-template:
+ name: next-android-armeabi-v7a-release
+ executor_name: ubuntu-disco
+ target_is_android: true
+ requires:
+ - next-sanity-checks
+ config_params: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_CCACHE=/usr/bin/ccache -DANDROID_ABI=armeabi-v7a'
+ - next-build-template:
+ name: next-android-arm64-v8a-release
+ executor_name: ubuntu-disco
+ target_is_android: true
+ requires:
+ - next-android-armeabi-v7a-release
+ config_params: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_CCACHE=/usr/bin/ccache -DANDROID_ABI=arm64-v8a'
+ - next-build-template:
+ name: next-android-x86-release
+ executor_name: ubuntu-disco
+ target_is_android: true
+ requires:
+ - next-android-armeabi-v7a-release
+ config_params: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_CCACHE=/usr/bin/ccache -DANDROID_ABI=x86'
+ - next-build-template:
+ name: next-android-x86_64-release
+ executor_name: ubuntu-disco
+ target_is_android: true
+ requires:
+ - next-android-armeabi-v7a-release
+ config_params: '-G Ninja -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_CCACHE=/usr/bin/ccache -DANDROID_ABI=x86_64'
+ - next-build-template:
+ name: next-linux-gcc8-release
+ executor_name: ubuntu-disco
+ target_is_linux: true
+ requires:
+ - next-sanity-checks
+ config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8'
+ - next-build-template:
+ name: next-linux-gcc4.9-release
+ executor_name: ubuntu-disco
+ target_is_linux: true
+ requires:
+ - next-linux-gcc8-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-glfw'
+ test_params: '-N -Q'
+ - next-build-template:
+ name: next-linux-gcc8-debug-coverage
+ executor_name: ubuntu-disco
+ target_is_linux: true
+ requires:
+ - next-linux-gcc8-release
+ config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 -DCMAKE_BUILD_TYPE=DebugCoverage'
+ - next-build-template:
+ name: next-linux-clang8-release
+ executor_name: ubuntu-disco
+ target_is_linux: true
+ requires:
+ - next-sanity-checks
+ config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8'
+ - next-build-template:
+ name: next-linux-asan
+ executor_name: ubuntu-disco
+ target_is_linux: true
+ requires:
+ - next-linux-gcc8-debug-coverage
+ 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'
+ - next-build-template:
+ name: next-linux-tsan
+ executor_name: ubuntu-disco
+ target_is_linux: true
+ requires:
+ - next-linux-gcc8-debug-coverage
+ 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'
+ - next-build-template:
+ name: next-linux-memsan
+ executor_name: ubuntu-disco
+ target_is_linux: true
+ requires:
+ - next-linux-gcc8-debug-coverage
+ 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'
+ - next-build-template:
+ name: next-linux-ubsan
+ executor_name: ubuntu-disco
+ target_is_linux: true
+ requires:
+ - next-linux-gcc8-debug-coverage
+ 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'
+ - next-build-template:
+ name: next-qt5-linux-gcc5-release
+ executor_name: ubuntu-disco
+ target_is_linux: true
+ requires:
+ - next-sanity-checks
+ config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-5 -DCMAKE_CXX_COMPILER=g++-5 -DMBGL_WITH_QT=ON'
+ - next-build-template:
+ name: next-qt5-macos-gcc5-release
+ executor_name: macos-11_0_0
+ target_is_macos: true
+ requires:
+ - next-qt5-linux-gcc5-release
+ config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DMBGL_WITH_QT=ON -DCMAKE_PREFIX_PATH=$(echo /usr/local/Cellar/qt/5.*/lib/cmake)'
+ test_params: '-N -Q'
+ - next-build-template:
+ name: next-macos-xcode11-release
+ executor_name: macos-11_0_0
+ target_is_macos: true
+ requires:
+ - next-sanity-checks
+ config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache'
+ - next-build-template:
+ name: next-macos-xcode11-debug
+ executor_name: macos-11_0_0
+ target_is_macos: true
+ requires:
+ - next-macos-xcode11-release
+ config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug'
+ - next-build-template:
+ name: next-ios-xcode11-release
+ executor_name: macos-11_0_0
+ target_is_macos: true
+ requires:
+ - next-sanity-checks
+ config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_SYSROOT=iphonesimulator'
+ test_params: '-Q -N'
+ mbgl-legacy:
jobs:
#
# Naming convention: {platform}-{additional description}-{build type}
@@ -47,8 +173,6 @@ workflows:
name: linux-clang-3.8-libcxx-debug
- linux-clang-7-sanitize-address-undefined
- linux-clang-7-sanitize-thread
- - linux-gcc49-debug:
- name: linux-gcc4.9-debug
- linux-gcc5-debug-coverage
- linux-doxygen
- linux-render-tests
@@ -83,7 +207,102 @@ workflows:
- ios-static-analyzer-nightly
- ios-static-analyzer-nightly-xcode11
+executors:
+ ubuntu-disco:
+ docker:
+ # FIXME: Move the image to mbgl/
+ - image: tmpsantos/mbgl_ci:1.5
+ resource_class: xlarge
+ working_directory: /src
+ environment:
+ UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=1
+ MSAN_OPTIONS: poison_in_dtor=1
+ ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1
+ QT_INSTALL_DOCS: /usr/share/qt5/doc
+ QT_VERSION: 5
+ macos-11_0_0:
+ macos:
+ xcode: '11.0.0'
+ environment:
+ HOMEBREW_NO_AUTO_UPDATE: 1
+ HOMEBREW_NO_INSTALL_CLEANUP: 1
+
commands:
+ next-prepare:
+ steps:
+ - restore_cache:
+ keys:
+ - 'ccache-v1-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }}'
+ - 'ccache-v1-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-'
+ - 'ccache-v1-{{ .Environment.CIRCLE_JOB }}-master'
+ - 'ccache-v1-{{ .Environment.CIRCLE_JOB }}-'
+ - run:
+ name: Prepare
+ command: |
+ git submodule sync
+ git submodule update --init --recursive
+ npm install --ignore-scripts
+ ulimit -c unlimited
+ next-prepare-macos:
+ steps:
+ - run:
+ name: Prepare macOS
+ command: |
+ brew install cmake ccache glfw ninja pkgconfig qt
+ next-config:
+ parameters:
+ config_params:
+ type: string
+ steps:
+ - run:
+ name: Configure
+ command: |
+ cmake next -B build << parameters.config_params >>
+ next-build:
+ parameters:
+ build_params:
+ type: string
+ steps:
+ - run:
+ name: Build
+ command: |
+ ccache --zero-stats --max-size=2G
+ cmake --build build -j 8 << parameters.build_params >>
+ ccache --show-stats
+ git gc
+ next-save:
+ steps:
+ - save_cache:
+ key: 'ccache-v1-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }}'
+ paths:
+ - .git/modules
+ - /Users/distiller/Library/Caches/Homebrew
+ - node_modules
+ - ~/.ccache
+ - ~/.gradle
+ - run:
+ name: Collecting artifacts
+ when: on_fail
+ command: |
+ mkdir -p /tmp/tests/coredumps
+ if ls core* 1> /dev/null 2>&1; then cp core* /tmp/tests/coredumps; fi
+ mkdir -p /tmp/tests/render
+ if [ -f mapbox-gl-js/test/integration/render-tests/index.html ]; then cp mapbox-gl-js/test/integration/render-tests/index.html /tmp/tests/render; fi
+ - store_artifacts:
+ path: /tmp/tests
+ destination: tests
+ next-test:
+ parameters:
+ test_wrapper:
+ type: string
+ test_params:
+ type: string
+ steps:
+ - run:
+ name: Test
+ command: |
+ cd build
+ << parameters.test_wrapper >> ctest -j 8 --output-on-failure << parameters.test_params >>
npm-install:
steps:
- run:
@@ -516,6 +735,92 @@ commands:
fi
jobs:
+ next-sanity-checks:
+ executor: ubuntu-disco
+ steps:
+ - checkout
+ - next-prepare
+ - next-config:
+ config_params: '-DMBGL_WITH_CORE_ONLY=ON'
+ - run:
+ name: CMake Format
+ command: |
+ cmake-format -i $(find next -type f -name CMakeLists.txt -o -name '*.cmake')
+ git diff --exit-code
+ - run:
+ name: Clang Format
+ command: |
+ git diff -U0 --no-color origin/master... *.cpp *.hpp | clang-format-diff-8 -p1 -i
+ git diff --exit-code
+ - run:
+ name: Clang Tidy
+ command: |
+ git diff -U0 --no-color origin/master... src include | clang-tidy-diff-8.py -clang-tidy-binary clang-tidy-8 -p1 -path build
+ - run:
+ name: Code Generators
+ command: |
+ platform/android/scripts/generate-style-code.js
+ scripts/generate-file-lists.js
+ scripts/generate-shaders.js
+ scripts/generate-style-code.js
+ git add -A && git diff --staged --exit-code
+ - next-save
+ next-build-template:
+ parameters:
+ config_params:
+ type: string
+ default: ''
+ build_params:
+ type: string
+ default: ''
+ test_params:
+ type: string
+ default: ''
+ executor_name:
+ type: string
+ target_is_android:
+ type: boolean
+ default: false
+ target_is_linux:
+ type: boolean
+ default: false
+ target_is_macos:
+ type: boolean
+ default: false
+ executor: << parameters.executor_name >>
+ steps:
+ - checkout
+ - next-prepare
+ - when:
+ condition: << parameters.target_is_android >>
+ steps:
+ - next-config:
+ config_params: << parameters.config_params >>
+ - next-build:
+ build_params: << parameters.build_params >>
+ - when:
+ condition: << parameters.target_is_linux >>
+ steps:
+ - next-config:
+ config_params: << parameters.config_params >>
+ - next-build:
+ build_params: << parameters.build_params >>
+ - next-test:
+ test_wrapper: 'xvfb-run -s -noreset'
+ test_params: << parameters.test_params >>
+ - when:
+ condition: << parameters.target_is_macos >>
+ steps:
+ - next-prepare-macos
+ - next-config:
+ config_params: << parameters.config_params >>
+ - next-build:
+ build_params: << parameters.build_params >>
+ - next-test:
+ test_wrapper: ''
+ test_params: << parameters.test_params >>
+ - next-save
+
nitpick:
docker:
- image: mbgl/linux-clang-7:a5a3c52107
diff --git a/scripts/ci/Dockerfile b/scripts/ci/Dockerfile
new file mode 100644
index 0000000000..648581044f
--- /dev/null
+++ b/scripts/ci/Dockerfile
@@ -0,0 +1,110 @@
+FROM ubuntu:disco-20190718
+
+ENV DEBIAN_FRONTEND="noninteractive"
+ENV ANDROID_HOME="/opt/android"
+
+WORKDIR /src
+
+# Use faster mirrors from Finland
+COPY etc/apt/sources.list /etc/apt
+
+RUN set -eu \
+ && apt-get update\
+ && apt-get dist-upgrade -y
+
+# CI requirements
+RUN set -eu && apt-get install -y \
+ ca-certificates \
+ git \
+ gzip \
+ ssh \
+ tar
+
+# Base dependencies
+RUN set -eu && apt-get install -y \
+ ccache \
+ clang-8 \
+ clang-format-8 \
+ clang-tidy-8 \
+ cmake \
+ fonts-noto \
+ g++-8 \
+ libc++-8-dev \
+ libc++abi-8-dev \
+ mesa-common-dev \
+ ninja-build \
+ nodejs \
+ npm \
+ pkg-config \
+ python3-pip \
+ software-properties-common \
+ xvfb
+
+RUN pip3 install cmake_format
+
+# Linux dependencies
+RUN set -eu && apt-get install -y \
+ libcurl4-openssl-dev \
+ libgl1-mesa-dev \
+ libglfw3-dev \
+ libicu-dev \
+ libjpeg-turbo8-dev \
+ libpng-dev \
+ libuv1-dev \
+ zlib1g-dev
+
+# Qt dependencies
+RUN set -eu && apt-get install -y \
+ qdoc-qt5 \
+ qt5-default
+
+# Android dependencies
+RUN set -eu && apt-get install -y \
+ coreutils \
+ curl \
+ openjdk-8-jdk-headless \
+ unzip
+
+# Install old compilers
+RUN set -eu \
+ && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1E9377A2BA9EF27F \
+ && add-apt-repository "deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu xenial main" \
+ && add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/ xenial main universe" \
+ && apt-get install -y \
+ g++-4.9 \
+ g++-5
+
+# Install Android NDK
+RUN set -eu \
+ && mkdir -p ${ANDROID_HOME} && cd ${ANDROID_HOME} \
+ && curl -L --retry 3 https://dl.google.com/android/repository/android-ndk-r19-linux-x86_64.zip -o ndk.zip \
+ && (echo "f02ad84cb5b6e1ff3eea9e6168037c823408c8ac ndk.zip" | sha1sum -c) \
+ && unzip -q ndk.zip && rm ndk.zip && mv android-ndk-r* ndk-bundle
+
+
+RUN set -eu \
+ && cd ${ANDROID_HOME} \
+ && curl -L --retry 3 https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip -o tools.zip \
+ && (echo "92ffee5a1d98d856634e8b71132e8a95d96c83a63fde1099be3d86df3106def9 tools.zip" | sha256sum -c) \
+ && unzip -q tools.zip && rm tools.zip
+
+RUN set -eu \
+ && yes | ${ANDROID_HOME}/tools/bin/sdkmanager \
+ "platform-tools" \
+ "platforms;android-26" \
+ "build-tools;26.0.3" \
+ "platforms;android-27" \
+ "build-tools;27.0.3" \
+ "platforms;android-28" \
+ "build-tools;28.0.3" \
+ "extras;android;m2repository" \
+ "patcher;v4" \
+ "extras;google;m2repository" \
+ "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" \
+ "cmake;3.10.2.4988404"
+
+# Configure ccache
+RUN set -eu && /usr/sbin/update-ccache-symlinks
+
+# Cleanup
+RUN set -eu && apt-get clean
diff --git a/scripts/ci/etc/apt/sources.list b/scripts/ci/etc/apt/sources.list
new file mode 100644
index 0000000000..c5359e131a
--- /dev/null
+++ b/scripts/ci/etc/apt/sources.list
@@ -0,0 +1,10 @@
+deb http://fi.archive.ubuntu.com/ubuntu/ disco main restricted
+deb http://fi.archive.ubuntu.com/ubuntu/ disco-updates main restricted
+deb http://fi.archive.ubuntu.com/ubuntu/ disco universe
+deb http://fi.archive.ubuntu.com/ubuntu/ disco-updates universe
+deb http://fi.archive.ubuntu.com/ubuntu/ disco multiverse
+deb http://fi.archive.ubuntu.com/ubuntu/ disco-updates multiverse
+deb http://fi.archive.ubuntu.com/ubuntu/ disco-backports main restricted universe multiverse
+deb http://security.ubuntu.com/ubuntu/ disco-security main restricted
+deb http://security.ubuntu.com/ubuntu/ disco-security universe
+deb http://security.ubuntu.com/ubuntu/ disco-security multiverse