Merge branch 'add-coverage-CI-job' into 'master'

Add coverage CI job and upload results to codecov.io

See merge request micro-ROS/ros_tracing/tracetools_analysis!65
This commit is contained in:
Christophe Bedard 2020-05-23 13:48:41 +00:00
commit 0692e32b22
3 changed files with 30 additions and 4 deletions

View file

@ -5,6 +5,10 @@ variables:
DISTRO: foxy
ROS2TRACING_BRANCH: master
stages:
- build_test
- report
.global_artifacts: &global_artifacts
artifacts:
paths:
@ -16,14 +20,28 @@ variables:
- build/*/test_results/*/*.xunit.xml
- build/*/pytest.xml
build:
image: $BASE_IMAGE_ID:$DISTRO
before_script:
before_script:
- . /root/ws/install/local_setup.sh
script:
- python3 get_branch.py --check
- git clone https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing.git --branch $(python3 get_branch.py)
build:
stage: build_test
image: $BASE_IMAGE_ID:$DISTRO
script:
- colcon build --symlink-install --event-handlers console_cohesion+ --packages-up-to $PACKAGES_LIST
- colcon test --event-handlers console_cohesion+ --packages-select $PACKAGES_LIST
- colcon test-result --all
<<: *global_artifacts
coverage:
stage: report
image: $BASE_IMAGE_ID:$DISTRO
script:
- colcon build --symlink-install --event-handlers console_cohesion+ --packages-up-to $PACKAGES_LIST --mixin coverage-pytest --cmake-args -DBUILD_TESTING=ON --no-warn-unused-cli
- colcon test --event-handlers console_cohesion+ --packages-select $PACKAGES_LIST --mixin coverage-pytest
- colcon test-result --all
- bash <(curl -s https://codecov.io/bash)
- colcon coveragepy-result --packages-select $PACKAGES_LIST --verbose --coverage-report-args -m
allow_failure: true
<<: *global_artifacts

View file

@ -0,0 +1,4 @@
[run]
omit =
setup.py
test/*

View file

@ -0,0 +1,4 @@
[run]
omit =
setup.py
test/*