Skip to content

[pre-commit.ci] pre-commit autoupdate #441

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #441

Workflow file for this run

name: Test github action
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
jobs:
action-test:
runs-on: ubuntu-22.04
container:
image: ${{ matrix.docker_image }}
env:
ARTIFACTS_DIR: data
TARGET_REPO: "ros2/geometry2"
TEST_LABEL: "gtest component_test"
strategy:
fail-fast: false
matrix:
ros_distribution:
- humble
- rolling
include:
# Humble Hawksbill (May 2022 - May 2027)
- ros_distribution: humble
docker_image: osrf/ros:humble-desktop
vcs_file: ros-metrics-reporter-humble.repos
# Rolling Ridley (June 2020 -)
- ros_distribution: rolling
docker_image: osrf/ros:rolling-desktop
vcs_file: ros-metrics-reporter-rolling.repos
steps:
- name: Clone main branch
uses: actions/checkout@v4
- name: Clone data branch
uses: actions/checkout@v4
with:
ref: data
path: ${{ env.ARTIFACTS_DIR }}
- uses: ros-tooling/setup-ros@v0.7
with:
required-ros-distributions: ${{ matrix.ros_distribution }}
- name: Build and test
id: build_and_test
uses: ros-tooling/action-ros-ci@v0.3
with:
target-ros2-distro: ${{ matrix.ros_distribution }}
vcs-repo-file-url: ${{ matrix.vcs_file }}
colcon-extra-args: --base-paths src/example/geometry2/
extra-cmake-args: -DCMAKE_CXX_FLAGS="-fprofile-arcs -ftest-coverage -DCOVERAGE_RUN=1" -DCMAKE_C_FLAGS="-fprofile-arcs -ftest-coverage -DCOVERAGE_RUN=1" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
colcon-defaults: |
{
"build": {
"mixin": ["coverage-gcc"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/1ddb69bedfd1f04c2f000e95452f7c24a4d6176b/index.yaml
- uses: actions/upload-artifact@v3
with:
name: colcon-logs
path: ${{ steps.build_and_test.outputs.ros-workspace-directory-name }}/log
if: always() # upload the logs even when the build fails
- name: Generate report
id: metrics-reporter
uses: ./ # Uses an action in the root directory
with:
artifacts-dir: ${{ env.ARTIFACTS_DIR }}
target-dir: ${{ steps.build_and_test.outputs.ros-workspace-directory-name }}
base-url: "https://tier4.github.io/ros-metrics-reporter/"
title: ${{ env.TARGET_REPO }}
ros-distro: ${{ matrix.ros_distribution }}
CCN: "20"
nloc: "200"
arguments: "6"
exclude: "**/pendulum_control/*"
codechecker-skip-list: "codechecker-skip-list.txt"
target-repository: ${{ env.TARGET_REPO }}
test-label: ${{ env.TEST_LABEL }}
- name: Check results
run: |
sudo apt install -y tree
tree -L 2 ${GITHUB_WORKSPACE}/public/
- name: Push artifacts
if: ${{ github.ref == 'refs/heads/main' && matrix.ros_distribution == 'humble' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ${{ env.ARTIFACTS_DIR }}
publish_branch: data
- name: Save page as artifacts
if: ${{ github.event.pull_request && matrix.ros_distribution == 'humble' }}
uses: actions/upload-artifact@v3
with:
name: static-pages
path: public
- name: Deploy public to gh-pages (main branch only)
if: ${{ github.ref == 'refs/heads/main' && matrix.ros_distribution == 'humble' }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: public