This will make the `next` buildsystem no longer the `next`, but the `actual`. The idea is to simplify the build, removing scripts, to make the platform buildsystem generated by CMake more compatible with IDEs and make development more streamlined. It will also make cross compilation easier.
644 lines
26 KiB
YAML
644 lines
26 KiB
YAML
version: 2.1
|
|
|
|
#
|
|
# This CI configuration heavily relies on templates and CMake. Most of the
|
|
# jobs will have the following steps (usually configurable via parameters):
|
|
# prepare, build and test.
|
|
#
|
|
# 'sanity-checks' and 'baselines' are special. The former will run a series
|
|
# of checks to see if the patch has the minimum requirements for landing in
|
|
# our repository and the latter will generate new baselines for the tests
|
|
# in case the PR changes the baselines.
|
|
#
|
|
workflows:
|
|
version: 2
|
|
development:
|
|
jobs:
|
|
- sanity-checks
|
|
- android-benchmark-runner
|
|
- android-api-breakage
|
|
- android-render-test-runner
|
|
- android-unit-test-runner
|
|
- ios-render-test-runner
|
|
- baselines:
|
|
requires:
|
|
- android-arm64-v8a-release
|
|
- android-armeabi-v7a-release
|
|
- android-render-test-runner
|
|
- android-x86-release
|
|
- android-x86_64-release
|
|
- linux-clang8-release
|
|
- linux-gcc8-release
|
|
- macos-xcode11-release
|
|
- ios-render-test-runner
|
|
- build-template:
|
|
name: android-armeabi-v7a-release
|
|
executor_name: ubuntu-disco
|
|
target_is_android: true
|
|
config_params: '-G Ninja -DCMAKE_INSTALL_PREFIX=/tmp/workspace/install/$CIRCLE_JOB -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_CCACHE=/usr/bin/ccache -DANDROID_ABI=armeabi-v7a'
|
|
install: true
|
|
- build-template:
|
|
name: android-arm64-v8a-release
|
|
executor_name: ubuntu-disco
|
|
target_is_android: true
|
|
config_params: '-G Ninja -DCMAKE_INSTALL_PREFIX=/tmp/workspace/install/$CIRCLE_JOB -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_CCACHE=/usr/bin/ccache -DANDROID_ABI=arm64-v8a'
|
|
build_params: '--target libmapbox-gl.so'
|
|
install: true
|
|
- build-template:
|
|
name: android-x86-release
|
|
executor_name: ubuntu-disco
|
|
target_is_android: true
|
|
config_params: '-G Ninja -DCMAKE_INSTALL_PREFIX=/tmp/workspace/install/$CIRCLE_JOB -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_CCACHE=/usr/bin/ccache -DANDROID_ABI=x86'
|
|
build_params: '--target libmapbox-gl.so'
|
|
install: true
|
|
- build-template:
|
|
name: android-x86_64-release
|
|
executor_name: ubuntu-disco
|
|
target_is_android: true
|
|
config_params: '-G Ninja -DCMAKE_INSTALL_PREFIX=/tmp/workspace/install/$CIRCLE_JOB -DCMAKE_TOOLCHAIN_FILE=/opt/android/ndk-bundle/build/cmake/android.toolchain.cmake -DANDROID_CCACHE=/usr/bin/ccache -DANDROID_ABI=x86_64'
|
|
build_params: '--target libmapbox-gl.so'
|
|
install: true
|
|
- build-template:
|
|
name: linux-gcc8-release
|
|
executor_name: ubuntu-disco
|
|
target_is_linux: true
|
|
config_params: '-G Ninja -DCMAKE_INSTALL_PREFIX=/tmp/workspace/install/$CIRCLE_JOB -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8'
|
|
install: true
|
|
metrics: true
|
|
style_tests: true
|
|
- build-template:
|
|
name: linux-gcc4.9-release
|
|
executor_name: ubuntu-disco
|
|
target_is_linux: true
|
|
requires:
|
|
- 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'
|
|
- build-template:
|
|
name: linux-gcc8-debug-coverage
|
|
executor_name: ubuntu-disco
|
|
target_is_linux: true
|
|
requires:
|
|
- 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=Debug -DMBGL_WITH_COVERAGE=ON'
|
|
style_tests: true
|
|
- build-template:
|
|
name: linux-clang8-release
|
|
executor_name: ubuntu-disco
|
|
target_is_linux: true
|
|
config_params: '-G Ninja -DCMAKE_INSTALL_PREFIX=/tmp/workspace/install/$CIRCLE_JOB -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8'
|
|
install: true
|
|
metrics: true
|
|
style_tests: true
|
|
- build-template:
|
|
name: FIXME-linux-asan
|
|
executor_name: ubuntu-disco
|
|
target_is_linux: true
|
|
requires:
|
|
- sanity-checks
|
|
config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8 -DMBGL_WITH_SANITIZER=address'
|
|
test_params: '|| true'
|
|
style_tests: true
|
|
- build-template:
|
|
name: linux-tsan
|
|
executor_name: ubuntu-disco
|
|
target_is_linux: true
|
|
requires:
|
|
- sanity-checks
|
|
config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8 -DMBGL_WITH_SANITIZER=thread'
|
|
style_tests: true
|
|
- build-template:
|
|
name: FIXME-linux-valgrind
|
|
executor_name: ubuntu-disco
|
|
target_is_linux: true
|
|
config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_CXX_FLAGS=-DSANITIZE'
|
|
test_params: '-j 4 -E "mbgl-node|gl-benchmark" -D ExperimentalMemCheck || true'
|
|
- build-template:
|
|
name: FIXME-linux-ubsan
|
|
executor_name: ubuntu-disco
|
|
target_is_linux: true
|
|
requires:
|
|
- sanity-checks
|
|
config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8 -DMBGL_WITH_SANITIZER=undefined'
|
|
test_params: '|| true'
|
|
style_tests: true
|
|
- build-template:
|
|
name: qt5-linux-gcc5-release
|
|
executor_name: ubuntu-disco
|
|
target_is_linux: true
|
|
config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-5 -DCMAKE_CXX_COMPILER=g++-5 -DMBGL_WITH_QT=ON'
|
|
- build-template:
|
|
name: qt5-macos-gcc5-release
|
|
executor_name: macos-11_0_0
|
|
target_is_macos: true
|
|
requires:
|
|
- 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)'
|
|
- build-template:
|
|
name: macos-xcode11-release
|
|
executor_name: macos-11_0_0
|
|
target_is_macos: true
|
|
config_params: '-G Ninja -DCMAKE_INSTALL_PREFIX=/tmp/workspace/install/$CIRCLE_JOB -DCMAKE_CXX_COMPILER_LAUNCHER=ccache'
|
|
install: true
|
|
metrics: true
|
|
style_tests: true
|
|
- build-template:
|
|
name: macos-xcode11-debug
|
|
executor_name: macos-11_0_0
|
|
target_is_macos: true
|
|
requires:
|
|
- macos-xcode11-release
|
|
config_params: '-G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug'
|
|
style_tests: true
|
|
- ios-xcode11-release
|
|
|
|
#
|
|
# Executors: we currently support two executors, one based on Ubuntu 19.04 aka Disco
|
|
# and another based on macOS + Xcode 11.1.0. The Ubuntu executor is a lot more stable
|
|
# and will produce reproduceable builds completely offline because it uses a docker
|
|
# image with all the build dependencies preinstalled, whereas the macOS is managed
|
|
# by CircleCI and will install dependencies on build time. Build results from the macOS
|
|
# bots might differ if in meantime the macOS image gets updated. :-(
|
|
#
|
|
executors:
|
|
ubuntu-disco:
|
|
docker:
|
|
# FIXME: Move the image to mbgl/
|
|
- image: tmpsantos/mbgl_ci:1.7
|
|
resource_class: xlarge
|
|
working_directory: /src
|
|
environment:
|
|
DISPLAY: :99
|
|
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=0
|
|
ASAN_OPTIONS: strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1:halt_on_error=0
|
|
QT_INSTALL_DOCS: /usr/share/qt5/doc
|
|
QT_VERSION: 5
|
|
TSAN_OPTIONS: suppressions=/src/platform/linux/tsan_suppress.txt
|
|
macos-11_0_0:
|
|
macos:
|
|
xcode: '11.1.0'
|
|
environment:
|
|
HOMEBREW_NO_AUTO_UPDATE: 1
|
|
HOMEBREW_NO_INSTALL_CLEANUP: 1
|
|
|
|
commands:
|
|
prepare:
|
|
steps:
|
|
- restore_cache:
|
|
keys:
|
|
- 'ccache-v1-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }}'
|
|
- 'ccache-v1-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-'
|
|
- 'ccache-v1-{{ .Environment.CIRCLE_JOB }}-master'
|
|
- run:
|
|
name: Prepare
|
|
command: |
|
|
git submodule sync
|
|
git submodule update --init --recursive
|
|
git gc
|
|
npm install --ignore-scripts
|
|
ulimit -c unlimited
|
|
prepare-linux:
|
|
steps:
|
|
- run:
|
|
name: Prepare Linux
|
|
background: true
|
|
command: |
|
|
Xvfb :99 -noreset -screen 0 1280x1024x24
|
|
prepare-macos:
|
|
steps:
|
|
- run:
|
|
name: Prepare macOS
|
|
command: |
|
|
brew install cmake ccache glfw ninja pkgconfig qt chargepoint/xcparse/xcparse
|
|
brew cask install google-cloud-sdk
|
|
- run:
|
|
name: Code Generators macOS
|
|
command: |
|
|
platform/darwin/scripts/generate-style-code.js
|
|
platform/darwin/scripts/update-examples.js
|
|
git add -A && git diff --staged --exit-code
|
|
config:
|
|
parameters:
|
|
config_params:
|
|
type: string
|
|
steps:
|
|
- run:
|
|
name: Configure
|
|
command: |
|
|
cmake . -B build << parameters.config_params >>
|
|
build:
|
|
parameters:
|
|
build_params:
|
|
type: string
|
|
steps:
|
|
- run:
|
|
name: Build
|
|
command: |
|
|
ccache --zero-stats --max-size=2G
|
|
cmake --build build -j $(nproc) << parameters.build_params >>
|
|
ccache --show-stats
|
|
install:
|
|
steps:
|
|
- run:
|
|
name: Install
|
|
command: |
|
|
cmake --build build --target install/strip
|
|
test:
|
|
parameters:
|
|
test_params:
|
|
type: string
|
|
steps:
|
|
- run:
|
|
name: Test
|
|
command: |
|
|
cd build
|
|
ctest -V << parameters.test_params >>
|
|
metrics:
|
|
parameters:
|
|
step_name:
|
|
type: string
|
|
metrics_params:
|
|
type: string
|
|
steps:
|
|
- run:
|
|
name: << parameters.step_name >>
|
|
command: |
|
|
build/mbgl-render-test-runner << parameters.metrics_params >>
|
|
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 results
|
|
when: always
|
|
command: |
|
|
mkdir -p /tmp/workspace/metrics && touch /tmp/workspace/.$CIRCLE_JOB
|
|
if [ -d metrics/$CIRCLE_JOB ]; then cp -r metrics/$CIRCLE_JOB /tmp/workspace/metrics; fi
|
|
mkdir -p /tmp/tests/baselines
|
|
if [ -f baselines.patch ]; then cp baselines.patch /tmp/tests/baselines; fi
|
|
mkdir -p /tmp/tests/nitpick
|
|
if [ -f nitpick.patch ]; then cp nitpick.patch /tmp/tests/nitpick; fi
|
|
mkdir -p /tmp/tests/render
|
|
if [ -f clang-tidy.log ]; then cp clang-tidy.log /tmp/tests/clang-tidy; fi
|
|
mkdir -p /tmp/tests/render
|
|
if ls render-test/*.html 1> /dev/null 2>&1; then cp render-test/*.html /tmp/tests/render; fi
|
|
mkdir -p /tmp/tests/metrics
|
|
if ls metrics/*.html 1> /dev/null 2>&1; then cp metrics/*.html /tmp/tests/metrics; fi
|
|
mkdir -p /tmp/tests/coredumps
|
|
if ls core* 1> /dev/null 2>&1; then cp core* /tmp/tests/coredumps; fi
|
|
mkdir -p /tmp/tests/valgrind
|
|
if ls build/Testing/Temporary/MemoryChecker.*.log 1> /dev/null 2>&1; then cp build/Testing/Temporary/MemoryChecker.*.log /tmp/tests/valgrind; fi
|
|
- persist_to_workspace:
|
|
root: /tmp/workspace
|
|
paths:
|
|
- '*'
|
|
- store_artifacts:
|
|
path: /tmp/tests
|
|
destination: tests
|
|
login-google-cloud-platform:
|
|
steps:
|
|
- run:
|
|
name: Login Google Cloud Platform
|
|
command: |
|
|
echo "${GCLOUD_SERVICE_ACCOUNT_JSON}" > secret.json
|
|
gcloud auth activate-service-account --key-file secret.json --project android-gl-native
|
|
rm secret.json
|
|
jobs:
|
|
ios-xcode11-release:
|
|
executor: macos-11_0_0
|
|
steps:
|
|
- checkout
|
|
- prepare
|
|
- prepare-macos
|
|
- run:
|
|
name: Build
|
|
command: |
|
|
cmake . -B Build -G Xcode -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_OSX_SYSROOT=iphonesimulator
|
|
cd Build && xcodebuild -sdk iphonesimulator -project Mapbox\ GL\ Native.xcodeproj -configuration Release
|
|
- save
|
|
ios-render-test-runner:
|
|
executor: macos-11_0_0
|
|
steps:
|
|
- checkout
|
|
- prepare
|
|
- prepare-macos
|
|
- run:
|
|
name: Prepare codesign keychain
|
|
command: |
|
|
cd render-test/ios
|
|
fastlane run create_keychain name:fastlane_keychain password:$FASTLANE_PASSWORD timeout:false unlock:true
|
|
fastlane match
|
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $FASTLANE_PASSWORD fastlane_keychain
|
|
/usr/bin/env xcrun security find-identity -v -p codesigning
|
|
- run:
|
|
name: Build IOS RenderTestApp
|
|
command: |
|
|
cd render-test/ios
|
|
cmake ../.. -B Build -G Xcode -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DMBGL_IOS_RENDER_TEST=ON
|
|
cd Build
|
|
xcodebuild -sdk iphoneos -project Mapbox\ GL\ Native.xcodeproj -scheme RenderTestApp build-for-testing -arch arm64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -configuration Release
|
|
xcodebuild -sdk iphoneos -project Mapbox\ GL\ Native.xcodeproj build -target RenderTestAppTests -arch arm64 CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -configuration Release
|
|
- run:
|
|
name: Codesign RenderTestApp for running on a physical device
|
|
command: |
|
|
cd render-test/ios
|
|
./codesigning/generate-entitlements.swift
|
|
ls codesigning
|
|
cd Build
|
|
../codesigning/codesign_all.sh
|
|
codesign -dv --verbose=4 Release-iphoneos/RenderTestApp.app # for debugging that app is signed or not
|
|
- run:
|
|
name: Login to IOS Google Cloud Platform
|
|
command: |
|
|
if [[ -n "${GCLOUD_SERVICE_ACCOUNT_JSON_IOS}" ]]; then
|
|
echo "${GCLOUD_SERVICE_ACCOUNT_JSON_IOS}" > iosAccount.json
|
|
gcloud auth activate-service-account --key-file iosAccount.json --project ios-mapbox-gl-native
|
|
rm iosAccount.json
|
|
fi
|
|
- run:
|
|
name: Run IOSRenderTestApp Tests on Firebase
|
|
no_output_timeout: 20m
|
|
command: |
|
|
if [[ -n "${GCLOUD_SERVICE_ACCOUNT_JSON_IOS}" ]]; then
|
|
# arrange files in a way Firebase expects it, and package them in a zip file
|
|
cd render-test/ios/Build
|
|
cp ../RenderTestApp_iphoneos13.2-arm64e-release.xctestrun .
|
|
zip testapp.zip -r Release-iphoneos/RenderTestApp.app --quiet
|
|
zip testapp.zip RenderTestApp_iphoneos13.2-arm64e-release.xctestrun
|
|
gcloud firebase test ios models list
|
|
gcloud firebase test ios run \
|
|
--test testapp.zip \
|
|
--device model=iphonexs,version=12.0,locale=en,orientation=portrait --xcode-version=11.1 --timeout 20m \
|
|
--verbosity=debug --no-record-video --results-dir ios-render-test-app-${CIRCLE_BUILD_NUM}
|
|
fi
|
|
- run:
|
|
name: Retrieve Test Result from gcloud
|
|
when: always
|
|
command: |
|
|
if [[ -n "${GCLOUD_SERVICE_ACCOUNT_JSON_IOS}" ]]; then
|
|
testResult=$(gsutil ls -d gs://test-lab-hn7kwqcz3108z-hjm4qtbqqkymk/ios-render-test-app-${CIRCLE_BUILD_NUM}/iphonexs-12.0-en-portrait/TestLogs/)
|
|
mkdir -p render-test-app
|
|
gsutil -m cp -r $testResult render-test-app
|
|
cd render-test-app/TestLogs
|
|
xcparse attachments *.xcresult && ls
|
|
cd ../.. && mkdir -p /tmp/tests/ios-render-test
|
|
if ls render-test-app/TestLogs/*.html 1> /dev/null 2>&1; then cp render-test-app/TestLogs/*.html /tmp/tests/ios-render-test; fi
|
|
if [[ -n $(ls render-test-app/TestLogs/*.zip 2>/dev/null) ]]; then
|
|
cp render-test-app/TestLogs/*.zip metrics/ios-render-test-runner/
|
|
cd metrics/ios-render-test-runner/
|
|
unzip *.zip
|
|
rm -rf *.zip
|
|
fi
|
|
fi
|
|
- save
|
|
android-benchmark-runner:
|
|
executor: ubuntu-disco
|
|
steps:
|
|
- checkout
|
|
- prepare
|
|
- run:
|
|
name: Build BenchmarkRunner APK
|
|
command: |
|
|
cd benchmark/android
|
|
./gradlew --parallel --max-workers=8 -Pmapbox.abis=arm64-v8a app:assembleRelease app:assembleAndroidTest
|
|
- login-google-cloud-platform
|
|
- run:
|
|
name: Run BenchmarkRunner on Firebase
|
|
no_output_timeout: 20m
|
|
command: |
|
|
gcloud firebase test android models list
|
|
gcloud firebase test android run --type instrumentation \
|
|
--app benchmark/android/app/build/outputs/apk/release/app-release.apk \
|
|
--test benchmark/android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk \
|
|
--device-ids flame --os-version-ids 29 --locales en --orientations portrait --timeout 20m \
|
|
--directories-to-pull /sdcard/benchmark/results --results-dir benchmark-${CIRCLE_BUILD_NUM} \
|
|
--no-record-video --no-performance-metrics
|
|
- run:
|
|
name: Retrieve TestResult from gcloud
|
|
when: always
|
|
command: |
|
|
testResult=$(gsutil ls gs://test-lab-186672a0qp5bq-ycr70axads3nc/benchmark-${CIRCLE_BUILD_NUM}/**/results/results.json)
|
|
mkdir -p /tmp/tests/benchmark
|
|
gsutil cp $testResult /tmp/tests/benchmark
|
|
android-api-breakage:
|
|
executor: ubuntu-disco
|
|
steps:
|
|
- run:
|
|
name: Clone mapbox-gl-native-android in working directory
|
|
command: git clone https://github.com/mapbox/mapbox-gl-native-android.git .
|
|
- prepare
|
|
- run:
|
|
name: Update mapbox-gl-native to match PR
|
|
command: cd vendor/mapbox-gl-native && git fetch origin $CIRCLE_SHA1 && git checkout $CIRCLE_SHA1 && git submodule update --init --recursive
|
|
- run:
|
|
name: Build SDK
|
|
command: BUILDTYPE=Release make android-arm-v8
|
|
- save
|
|
android-unit-test-runner:
|
|
executor: ubuntu-disco
|
|
steps:
|
|
- checkout
|
|
- prepare
|
|
- run:
|
|
name: Build UnitTestRunner APK
|
|
command: |
|
|
cd test/android
|
|
./gradlew --parallel --max-workers=8 -Pmapbox.abis=arm64-v8a app:assembleRelease app:assembleAndroidTest
|
|
- login-google-cloud-platform
|
|
- run:
|
|
name: Run UnitTestRunner on Firebase
|
|
no_output_timeout: 20m
|
|
command: |
|
|
gcloud firebase test android models list
|
|
gcloud firebase test android run --type instrumentation \
|
|
--app test/android/app/build/outputs/apk/release/app-release.apk \
|
|
--test test/android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk \
|
|
--device-ids flame --os-version-ids 29 --locales en --orientations portrait --timeout 20m \
|
|
--directories-to-pull /sdcard/test/results --results-dir unit-test-${CIRCLE_BUILD_NUM} \
|
|
--no-record-video --no-performance-metrics
|
|
- run:
|
|
name: Retrieve Test Result from gcloud
|
|
when: always
|
|
command: |
|
|
testResult=$(gsutil ls gs://test-lab-186672a0qp5bq-ycr70axads3nc/unit-test-${CIRCLE_BUILD_NUM}/**/results/results.xml)
|
|
mkdir -p /tmp/tests/unit-test
|
|
gsutil cp $testResult /tmp/tests/unit-test
|
|
- save
|
|
android-render-test-runner:
|
|
executor: ubuntu-disco
|
|
steps:
|
|
- checkout
|
|
- prepare
|
|
- run:
|
|
name: Build RenderTestRunner APK
|
|
command: |
|
|
cd render-test/android
|
|
./gradlew --parallel --max-workers=8 -Pmapbox.abis=arm64-v8a app:assembleRelease app:assembleAndroidTest
|
|
- login-google-cloud-platform
|
|
- run:
|
|
name: Run RenderTestRunner Instrumentation Test on Firebase
|
|
no_output_timeout: 20m
|
|
command: |
|
|
gcloud firebase test android models list
|
|
gcloud firebase test android run --type instrumentation \
|
|
--app render-test/android/app/build/outputs/apk/release/app-release.apk \
|
|
--test render-test/android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk \
|
|
--device-ids flame --os-version-ids 29 --locales en --orientations portrait --timeout 20m \
|
|
--directories-to-pull /sdcard --results-dir render-test-app-${CIRCLE_BUILD_NUM} \
|
|
--no-record-video --no-performance-metrics
|
|
- run:
|
|
name: Retrieve TestResult from gcloud
|
|
when: always
|
|
command: |
|
|
testResult=$(gsutil ls gs://test-lab-186672a0qp5bq-ycr70axads3nc/render-test-app-${CIRCLE_BUILD_NUM}/**/*.html)
|
|
mkdir -p /tmp/tests/render-test-app
|
|
gsutil cp $testResult /tmp/tests/render-test-app
|
|
- run:
|
|
name: Retrieve Rebaselined Metrics from gcloud
|
|
command: |
|
|
metricsResult=$(gsutil ls -d gs://test-lab-186672a0qp5bq-ycr70axads3nc/render-test-app-${CIRCLE_BUILD_NUM}/*/*/sdcard/baselines/*) || true
|
|
gsutil -m cp -r $metricsResult metrics/android-render-test-runner/ || true
|
|
- save
|
|
sanity-checks:
|
|
executor: ubuntu-disco
|
|
steps:
|
|
- checkout
|
|
- prepare
|
|
- config:
|
|
config_params: '-G Ninja -DCMAKE_C_COMPILER=clang-8 -DCMAKE_CXX_COMPILER=clang++-8'
|
|
- run:
|
|
name: Code Generators
|
|
command: |
|
|
platform/default/include/mbgl/storage/offline_schema.js
|
|
scripts/generate-file-lists.js
|
|
scripts/generate-shaders.js
|
|
scripts/generate-style-code.js
|
|
git add -A && git diff --staged --exit-code | tee nitpick.patch
|
|
- run:
|
|
name: Validation Scripts
|
|
command: |
|
|
scripts/nitpick/submodule-pin.js
|
|
- run:
|
|
name: CMake Format
|
|
command: |
|
|
cmake-format -i $(find -name '*.cmake' -and -not -path './vendor/*/*' -and -not -path './build/*')
|
|
cmake-format -i $(find -name CMakeLists.txt -and -not -path './vendor/*/*' -and -not -path './build/*')
|
|
git diff --exit-code | tee nitpick.patch
|
|
- run:
|
|
name: Clang Format
|
|
command: |
|
|
git diff -U0 --ignore-submodules=all --no-color origin/master... *.cpp *.hpp | clang-format-diff-8 -p1 -i
|
|
git diff --exit-code | tee nitpick.patch
|
|
- run:
|
|
name: Clang Tidy
|
|
command: |
|
|
run-clang-tidy-8 -quiet -j $(nproc) -p build $PWD/src/.*cpp $PWD/platform/.*cpp |tee clang-tidy.log
|
|
grep -o \\[[a-z].*-.*[a-z]\] clang-tidy.log |sort |uniq -c |sort -n
|
|
- save
|
|
baselines:
|
|
executor: ubuntu-disco
|
|
steps:
|
|
- checkout
|
|
- prepare
|
|
- prepare-linux
|
|
- attach_workspace:
|
|
at: /tmp/attach
|
|
- run:
|
|
name: 'Binary Size'
|
|
command: |
|
|
/tmp/attach/install/linux-gcc8-release/bin/mbgl-render-test-runner -u rebaseline -p metrics/binary-size.json
|
|
- run:
|
|
name: 'Matrics Baselines'
|
|
command: |
|
|
cp -r /tmp/attach/metrics .
|
|
git add -A && git diff --staged --exit-code | tee baselines.patch
|
|
- save
|
|
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
|
|
install:
|
|
type: boolean
|
|
default: false
|
|
metrics:
|
|
type: boolean
|
|
default: false
|
|
style_tests:
|
|
type: boolean
|
|
default: false
|
|
executor: << parameters.executor_name >>
|
|
steps:
|
|
- checkout
|
|
- when:
|
|
condition: << parameters.target_is_android >>
|
|
steps:
|
|
- prepare
|
|
- config:
|
|
config_params: << parameters.config_params >>
|
|
- build:
|
|
build_params: << parameters.build_params >>
|
|
- when:
|
|
condition: << parameters.target_is_linux >>
|
|
steps:
|
|
- prepare
|
|
- prepare-linux
|
|
- config:
|
|
config_params: << parameters.config_params >>
|
|
- build:
|
|
build_params: << parameters.build_params >>
|
|
- test:
|
|
test_params: << parameters.test_params >>
|
|
- when:
|
|
condition: << parameters.target_is_macos >>
|
|
steps:
|
|
- prepare
|
|
- prepare-macos
|
|
- config:
|
|
config_params: << parameters.config_params >>
|
|
- build:
|
|
build_params: << parameters.build_params >>
|
|
- test:
|
|
test_params: << parameters.test_params >>
|
|
- when:
|
|
condition: << parameters.install >>
|
|
steps:
|
|
- install
|
|
- when:
|
|
condition: << parameters.style_tests >>
|
|
steps:
|
|
- metrics:
|
|
step_name: 'Style Tests'
|
|
metrics_params: '-u rebaseline -p metrics/$CIRCLE_JOB-style.json'
|
|
- when:
|
|
condition: << parameters.metrics >>
|
|
steps:
|
|
- metrics:
|
|
step_name: 'Metrics'
|
|
metrics_params: '-u rebaseline -p metrics/$CIRCLE_JOB-metrics.json'
|
|
- save
|