From 7d7bf6be4223b3dbe8c487e7cb085ca0f5ab9f3b Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Tue, 27 Apr 2021 18:30:31 -0400 Subject: [PATCH 1/2] Split build/test jobs into two separate stages and use 'needs' Signed-off-by: Christophe Bedard --- .gitlab-ci.yml | 45 ++++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd6a624..3bd6af7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,13 +6,23 @@ variables: ROS2TRACING_BRANCH: master stages: - - build_test + - build + - test - report -.global_artifacts: &global_artifacts +.before_script_build: &before_script_build + before_script: + - . /root/ws/install/local_setup.sh + - python3 get_branch.py --check + - git clone https://gitlab.com/ros-tracing/ros2_tracing.git --branch $(python3 get_branch.py) +.build_artifacts: &build_artifacts + artifacts: + paths: + - install/ + - build/ +.test_artifacts: &test_artifacts artifacts: paths: - - install - build/*/test_results/*/*.xunit.xml - build/*/pytest.xml reports: @@ -20,37 +30,45 @@ stages: - 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/ros-tracing/ros2_tracing.git --branch $(python3 get_branch.py) - build: - stage: build_test + stage: build image: $BASE_IMAGE_ID:$DISTRO + <<: *before_script_build script: - colcon build --symlink-install --event-handlers console_cohesion+ --packages-up-to $PACKAGES_LIST + <<: *build_artifacts + +test: + stage: test + image: $BASE_IMAGE_ID:$DISTRO + needs: + - build + dependencies: + - build + script: + - . /root/ws/install/local_setup.sh - colcon test --event-handlers console_cohesion+ --packages-select $PACKAGES_LIST - colcon test-result --all --verbose - <<: *global_artifacts + <<: *test_artifacts coverage: stage: report image: $BASE_IMAGE_ID:$DISTRO + needs: + - test + <<: *before_script_build script: - - pip3 install -U codecov - 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 --verbose - colcon coveragepy-result --packages-select $PACKAGES_LIST --verbose --coverage-report-args -m + - pip3 install -U codecov - codecov --file coveragepy/.coverage allow_failure: true - <<: *global_artifacts dco: stage: report image: $BASE_IMAGE_ID:$DISTRO-base - before_script: [] script: - pip3 install -U dco-check - dco-check --verbose @@ -60,5 +78,6 @@ trigger_gen_docs: only: refs: - master + - galactic - foxy trigger: ros-tracing/tracetools_analysis-api From b3828f016eee056b532d8eeaac07c13fa3969640 Mon Sep 17 00:00:00 2001 From: Christophe Bedard Date: Tue, 27 Apr 2021 18:30:46 -0400 Subject: [PATCH 2/2] Print LTTng version before building Signed-off-by: Christophe Bedard --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3bd6af7..3246452 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,6 +35,7 @@ build: image: $BASE_IMAGE_ID:$DISTRO <<: *before_script_build script: + - lttng --version && apt list lttng-tools liblttng-ust-dev python3-lttng python3-babeltrace - colcon build --symlink-install --event-handlers console_cohesion+ --packages-up-to $PACKAGES_LIST <<: *build_artifacts