Skip to content

Commit 0ea62e3

Browse files
committed
Add AWS CodeBuild spec to run codecov w cmake
This is not a part of CI.
1 parent 69dbdef commit 0ea62e3

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

buildspec-linux-cmake-gcc-cov.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: 0.2
2+
3+
env:
4+
variables:
5+
# CodeBuild console doesn't display color codes correctly
6+
TESTPL_COLOR_OUTPUT: 0
7+
8+
phases:
9+
install:
10+
runtime-versions:
11+
java: openjdk8
12+
commands:
13+
- sed -i 's#/archive.ubuntu.com#/us-east-1.ec2.archive.ubuntu.com#g' /etc/apt/sources.list
14+
- add-apt-repository ppa:ubuntu-toolchain-r/test
15+
- apt-get update -y
16+
- apt-get install -y flex bison make git libwww-perl patch ccache libc6-dev-i386 jq lcov cmake curl gdb python-pip
17+
- pip install codecov
18+
build:
19+
commands:
20+
- echo Build started on `date`
21+
- git submodule update --init --recursive
22+
- cmake -H. -Bbuild '-Denable_coverage=1' '-Dparallel_tests=2' '-DCMAKE_CXX_COMPILER=/usr/bin/g++'
23+
- cmake --build build --target coverage -- -j2
24+
post_build:
25+
commands:
26+
- lcov --capture --directory build --output-file ./lcov.info
27+
- VCS_PULL_REQUEST=$(echo $CODEBUILD_SOURCE_VERSION | sed 's/pr\///g')
28+
- COV_SCRIPT=/root/.cache/codecov.sh
29+
- if [ ! -f "$COV_SCRIPT" ]; then curl -s https://codecov.io/bash > "$COV_SCRIPT"; fi
30+
- echo "$CODEBUILD_INITIATOR" | grep GitHub && bash "$COV_SCRIPT" -t "$CODECOV_TOKEN" || true
31+
- echo Build completed on `date`
32+
cache:
33+
paths:
34+
- '/var/cache/apt/**/*'
35+
- '/var/lib/apt/lists/**/*'
36+
- '/root/.ccache/**/*'
37+
- '/root/.cache/codecov.sh'

0 commit comments

Comments
 (0)