Skip to content

Commit c683327

Browse files
committed
Add AWS CodeBuild spec to run codecov
1 parent 3093e86 commit c683327

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

buildspec-linux-make-gcc-cov.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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 cmake3 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+
- VCS_PULL_REQUEST=$(echo $CODEBUILD_SOURCE_VERSION | sed 's/pr\///g')
27+
- COV_SCRIPT=/root/.cache/codecov.sh
28+
- if [ ! -f "$COV_SCRIPT" ]; then curl -s https://codecov.io/bash > "$COV_SCRIPT"; fi
29+
- echo "$CODEBUILD_INITIATOR" | grep GitHub && bash "$COV_SCRIPT" -t "$CODECOV_TOKEN" || true
30+
cache:
31+
paths:
32+
- '/var/cache/apt/**/*'
33+
- '/var/lib/apt/lists/**/*'
34+
- '/root/.ccache/**/*'
35+
- '/root/.cache/codecov.sh'
36+

0 commit comments

Comments
 (0)