Skip to content

Commit 3cdee52

Browse files
committed
Simplify codecov make and cmake configuration
Do not apt install unneeded packages, and commit coverage data even when the build was not initiated by github.
1 parent 0a990c7 commit 3cdee52

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

buildspec-linux-cmake-gcc-cov.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ phases:
1313
- sed -i 's#/archive.ubuntu.com#/us-east-1.ec2.archive.ubuntu.com#g' /etc/apt/sources.list
1414
- add-apt-repository ppa:ubuntu-toolchain-r/test
1515
- 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
16+
- apt-get install -y flex bison make git libwww-perl patch ccache libc6-dev-i386 jq lcov cmake curl gdb
1817
build:
1918
commands:
2019
- echo Build started on `date`
@@ -23,11 +22,11 @@ phases:
2322
- cmake --build build --target coverage -- -j2
2423
post_build:
2524
commands:
26-
- lcov --capture --directory build --output-file ./lcov.info
25+
- lcov --capture --directory build --output-file lcov.info
2726
- VCS_PULL_REQUEST=$(echo $CODEBUILD_SOURCE_VERSION | sed 's/pr\///g')
2827
- COV_SCRIPT=/root/.cache/codecov.sh
2928
- 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
29+
- bash "$COV_SCRIPT" -t "$CODECOV_TOKEN" || true
3130
- echo Build completed on `date`
3231
cache:
3332
paths:

buildspec-linux-make-gcc-cov.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ phases:
1212
commands:
1313
- sed -i 's#/archive.ubuntu.com#/us-east-1.ec2.archive.ubuntu.com#g' /etc/apt/sources.list
1414
- apt-get update -y
15-
- apt-get install -y flex bison make git libwww-perl patch ccache libc6-dev-i386 jq gdb lcov curl python-pip
16-
- pip install codecov
15+
- apt-get install -y flex bison make git libwww-perl patch ccache libc6-dev-i386 jq gdb lcov curl
1716
build:
1817
commands:
1918
- echo Build started on `date`
@@ -26,19 +25,22 @@ phases:
2625
post_build:
2726
commands:
2827
- make -C unit test
28+
# Also enable compilation with coverage/profiling flags when running the
29+
# regression tests, to also get results for the driver program in
30+
# regression/invariants
2931
- make -C regression test CPROVER_WITH_PROFILING=1
3032
- make -C regression/cbmc test-paths-lifo
3133
- env PATH=$PATH:`pwd`/src/solvers make -C regression/cbmc test-cprover-smt2
3234
- make -C jbmc/unit test
3335
- make -C jbmc/regression test
34-
- lcov --capture --directory . --output-file ./lcov.info
36+
- lcov --capture --directory . --output-file lcov.info
3537
# If $CODEBUILD_SOURCE_VERSION starts with 'pr/', filter out pr number, if not, return empty
3638
- VCS_PULL_REQUEST=$(echo $CODEBUILD_SOURCE_VERSION | sed '/^pr\//!d;s/^pr\///')
3739
# If $CODEBUILD_SOURCE_VERSION is commit id, set $VCS_COMMIT_ID
3840
- VCS_COMMIT_ID=$(echo $CODEBUILD_SOURCE_VERSION | sed -r '/^[a-z0-9]{40}$/!d')
3941
- COV_SCRIPT=/root/.cache/codecov.sh
4042
- if [ ! -f "$COV_SCRIPT" ]; then curl -s https://codecov.io/bash > "$COV_SCRIPT"; fi
41-
- echo "$CODEBUILD_INITIATOR" | grep GitHub && bash "$COV_SCRIPT" -t "$CODECOV_TOKEN" || true
43+
- bash $COV_SCRIPT -t "$CODECOV_TOKEN" || true
4244
- echo Build completed on `date`
4345
cache:
4446
paths:

0 commit comments

Comments
 (0)