-
Notifications
You must be signed in to change notification settings - Fork 274
Add codecov #4448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add codecov #4448
Changes from all commits
c1b1d07
0ef5e78
69dbdef
0ea62e3
a780511
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
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' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
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 | ||
- apt-get update -y | ||
- apt-get install -y flex bison make git libwww-perl patch ccache libc6-dev-i386 jq gdb lcov curl python-pip | ||
- pip install codecov | ||
build: | ||
commands: | ||
- echo Build started on `date` | ||
- make -C src minisat2-download | ||
- make -C jbmc/src setup-submodules | ||
- make -C src CXX="ccache g++" -j2 CPROVER_WITH_PROFILING=1 | ||
- make -C unit CXX="ccache g++" -j2 CPROVER_WITH_PROFILING=1 | ||
- make -C jbmc/src CXX="ccache g++" -j2 CPROVER_WITH_PROFILING=1 | ||
- make -C jbmc/unit CXX="ccache g++" -j2 CPROVER_WITH_PROFILING=1 | ||
post_build: | ||
commands: | ||
- make -C unit test | ||
- make -C regression test CPROVER_WITH_PROFILING=1 | ||
- make -C regression/cbmc test-paths-lifo | ||
- env PATH=$PATH:`pwd`/src/solvers make -C regression/cbmc test-cprover-smt2 | ||
- make -C jbmc/unit test | ||
- make -C jbmc/regression test | ||
- lcov --capture --directory . --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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't fully understand what this line is doing (I'm afraid I don't know what the contents of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, essentially I blindly used script example here Do you want me to try removing the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm honestly not sure on the |
||
- echo Build completed on `date` | ||
cache: | ||
paths: | ||
- '/var/cache/apt/**/*' | ||
- '/var/lib/apt/lists/**/*' | ||
- '/root/.ccache/**/*' | ||
- '/root/.cache/codecov.sh' |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,11 @@ else | |
CXXFLAGS += -Wall -pedantic -Werror -Wno-deprecated-declarations -Wswitch-enum | ||
endif | ||
|
||
ifeq ($(CPROVER_WITH_PROFILING),1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know you mentioned that somehow CMake unit tests fail if coverage is enabled, but I think it would still be preferable if we kept Make and CMake builds in sync, and at least adding these options to CMake would be good - even if you raise an issue in the GitHub issue tracker to cover whatever failures you see in CMake unit tests rather than also fixing them in this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True. The thing is this invariant violation happens only codebuild, and I've tried to reproduce it on local codebuild docker, it did not reproduce. I have a gut feeling though initially, cbmc-codecov environment was There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chrisr-diffblue , OK, so perhaps the invariant violation I observed was because of AWS image. I no longer observe it. I still have a problem codecov does not find existing coverage files from the VM. I will push just one more time with extra |
||
CXXFLAGS += -fprofile-arcs -ftest-coverage | ||
LINKFLAGS += -lgcov -fprofile-arcs | ||
endif | ||
|
||
# Select optimisation or debug info | ||
#CXXFLAGS += -O2 -DNDEBUG | ||
#CXXFLAGS += -O0 -g | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is VCS_PULL_REQUEST actually used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not too sure. As I referred in another your question. I took this 4 lines of scripts from codecov/codecov-python#140.