From df65eebfca4e9da866ca82e03da9c89fa3ac8fc6 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Sat, 23 May 2020 09:43:57 -0400 Subject: [PATCH] Add coverage CI job and upload results to codecov.io Signed-off-by: Christophe Bedard --- .gitlab-ci.yml | 26 ++++++++++++++++++++++---- ros2trace_analysis/.coveragerc | 4 ++++ tracetools_analysis/.coveragerc | 4 ++++ 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 ros2trace_analysis/.coveragerc create mode 100644 tracetools_analysis/.coveragerc diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bd56ba4..982cdfe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 +before_script: + - . /root/ws/install/local_setup.sh + - 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 - 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) - 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 diff --git a/ros2trace_analysis/.coveragerc b/ros2trace_analysis/.coveragerc new file mode 100644 index 0000000..2536a4b --- /dev/null +++ b/ros2trace_analysis/.coveragerc @@ -0,0 +1,4 @@ +[run] +omit = + setup.py + test/* diff --git a/tracetools_analysis/.coveragerc b/tracetools_analysis/.coveragerc new file mode 100644 index 0000000..2536a4b --- /dev/null +++ b/tracetools_analysis/.coveragerc @@ -0,0 +1,4 @@ +[run] +omit = + setup.py + test/*