Add coverage CI job and upload results to codecov.io

Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
This commit is contained in:
Christophe Bedard 2020-05-23 09:43:57 -04:00
parent 5e845fe196
commit df65eebfca
3 changed files with 30 additions and 4 deletions

View file

@ -5,6 +5,10 @@ variables:
DISTRO: foxy DISTRO: foxy
ROS2TRACING_BRANCH: master ROS2TRACING_BRANCH: master
stages:
- build_test
- report
.global_artifacts: &global_artifacts .global_artifacts: &global_artifacts
artifacts: artifacts:
paths: paths:
@ -16,14 +20,28 @@ variables:
- build/*/test_results/*/*.xunit.xml - build/*/test_results/*/*.xunit.xml
- build/*/pytest.xml - build/*/pytest.xml
build:
image: $BASE_IMAGE_ID:$DISTRO
before_script: before_script:
- . /root/ws/install/local_setup.sh - . /root/ws/install/local_setup.sh
script:
- python3 get_branch.py --check - python3 get_branch.py --check
- git clone https://gitlab.com/micro-ROS/ros_tracing/ros2_tracing.git --branch $(python3 get_branch.py) - 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 build --symlink-install --event-handlers console_cohesion+ --packages-up-to $PACKAGES_LIST
- colcon test --event-handlers console_cohesion+ --packages-select $PACKAGES_LIST - colcon test --event-handlers console_cohesion+ --packages-select $PACKAGES_LIST
- colcon test-result --all - colcon test-result --all
<<: *global_artifacts <<: *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/*