38 lines
1.3 KiB
YAML
38 lines
1.3 KiB
YAML
version: 0.2
|
|
|
|
env:
|
|
variables:
|
|
# CodeBuild console doesn't display color codes correctly
|
|
TESTPL_COLOR_OUTPUT: 0
|
|
|
|
phases:
|
|
install:
|
|
runtime-versions:
|
|
java: openjdk8
|
|
commands:
|
|
- sed -i 's#/archive.ubuntu.com#/us-east-1.ec2.archive.ubuntu.com#g' /etc/apt/sources.list
|
|
- add-apt-repository ppa:ubuntu-toolchain-r/test
|
|
- apt-get update -y
|
|
- apt-get install -y flex bison make git libwww-perl patch ccache libc6-dev-i386 jq lcov cmake curl gdb python-pip
|
|
- pip install codecov
|
|
build:
|
|
commands:
|
|
- echo Build started on `date`
|
|
- git submodule update --init --recursive
|
|
- cmake -H. -Bbuild '-Denable_coverage=1' '-Dparallel_tests=2' '-DCMAKE_CXX_COMPILER=/usr/bin/g++'
|
|
- cmake --build build --target coverage -- -j2
|
|
post_build:
|
|
commands:
|
|
- lcov --capture --directory build --output-file ./lcov.info
|
|
- VCS_PULL_REQUEST=$(echo $CODEBUILD_SOURCE_VERSION | sed 's/pr\///g')
|
|
- COV_SCRIPT=/root/.cache/codecov.sh
|
|
- if [ ! -f "$COV_SCRIPT" ]; then curl -s https://codecov.io/bash > "$COV_SCRIPT"; fi
|
|
- echo "$CODEBUILD_INITIATOR" | grep GitHub && bash "$COV_SCRIPT" -t "$CODECOV_TOKEN" || true
|
|
- echo Build completed on `date`
|
|
cache:
|
|
paths:
|
|
- '/var/cache/apt/**/*'
|
|
- '/var/lib/apt/lists/**/*'
|
|
- '/root/.ccache/**/*'
|
|
- '/root/.cache/codecov.sh'
|