-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
404 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
set -ex | ||
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
LANELET2_ROOT=$(dirname $SCRIPT_DIR) | ||
WORKSPACE_ROOT=$(dirname $(dirname $LANELET2_ROOT)) | ||
|
||
src_dirs="" | ||
for d in ${LANELET2_ROOT}/*/ ; do | ||
[ "$(basename $d)" = ".github" ] && continue | ||
[ "$(basename $d)" = "lanelet2" ] && continue | ||
src_dirs="${src_dirs} ${d}*" | ||
done | ||
|
||
lcov_filtered_files="" | ||
for d in ${LANELET2_ROOT}/*/ ; do | ||
[ "$(basename $d)" = ".github" ] && continue | ||
[ "$(basename $d)" = "lanelet2" ] && continue | ||
pkg="$(basename $d)" | ||
build_dir="${WORKSPACE_ROOT}/build/${pkg}" | ||
|
||
file="${build_dir}/mrt_coverage/full_coverage.lcov" | ||
if [ -f "$file" ]; then | ||
filtered_path="${build_dir}/mrt_coverage/full_coverage_filtered.lcov" | ||
|
||
set -f | ||
lcov -o ${filtered_path} -e ${file}${src_dirs} | ||
set +f | ||
|
||
lcov_filtered_files="${lcov_filtered_files} -a ${filtered_path}" | ||
fi; | ||
done | ||
|
||
mkdir -p "${WORKSPACE_ROOT}/lcov" | ||
lcov -o "${WORKSPACE_ROOT}/lcov/full_coverage.lcov" ${lcov_filtered_files} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
set -ex | ||
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" | ||
LANELET2_ROOT=$(dirname $SCRIPT_DIR) | ||
|
||
export BUILD_DIR=/tmp/lanelet2_build_lint_$(id -u) | ||
|
||
# setup mrt_cmake_modules, otherwise assume it's installed | ||
set +x | ||
source /opt/ros/*/setup.bash | ||
set -x | ||
if [[ -e $LANELET2_ROOT/../mrt_cmake_modules ]]; then | ||
mkdir -p $BUILD_DIR/mrt_cmake_modules | ||
pushd $BUILD_DIR/mrt_cmake_modules | ||
cmake $LANELET2_ROOT/../mrt_cmake_modules -DCMAKE_INSTALL_PREFIX=$BUILD_DIR/mrt_cmake_modules | ||
make install | ||
popd | ||
fi | ||
|
||
# make sure cmake finds everything | ||
export CMAKE_PREFIX_PATH=$BUILD_DIR/mrt_cmake_modules:${CMAKE_PREFIX_PATH} | ||
export AMENT_PREFIX_PATH=${LANELET2_ROOT} | ||
|
||
# generate a compile_commands.json by configuring all lanelet2 packages in a big project | ||
CMAKE_ROOT=${LANELET2_ROOT}/CMakeLists.txt | ||
echo "cmake_minimum_required(VERSION 3.12)" > ${CMAKE_ROOT} | ||
echo "project(lanelet2)" >> ${CMAKE_ROOT} | ||
export LANELET2_PACKAGES_TOPOLOGICAL="lanelet2_core lanelet2_io lanelet2_projection lanelet2_traffic_rules lanelet2_routing lanelet2_maps lanelet2_validation lanelet2_matching lanelet2_python lanelet2_examples" | ||
for pkg in $LANELET2_PACKAGES_TOPOLOGICAL; do | ||
echo "add_subdirectory($pkg)" >> ${CMAKE_ROOT}; | ||
echo "set(${pkg}_LIBRARIES $pkg)" >> ${CMAKE_ROOT}; | ||
done | ||
pushd $BUILD_DIR | ||
cmake $LANELET2_ROOT -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCATKIN_ENABLE_TESTING=1 | ||
popd | ||
|
||
# run clang-tidy | ||
find . -name "*.cpp" -print0 | xargs -0 -I{} -P$(nproc --all) clang-tidy-11 -p $BUILD_DIR {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,178 @@ | ||
name: Lanelet2 CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- "**" | ||
tags: | ||
- "**" | ||
# Run tests for any PRs. | ||
pull_request: | ||
|
||
jobs: | ||
formatting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup docker buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Setup docker cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.docker-cache | ||
key: ${{runner.os}}-docker-humble | ||
|
||
- name: Build dependencies | ||
uses: docker/build-push-action@v3 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
tags: lanelet2_src | ||
cache-from: type=local,src=/tmp/.docker-cache | ||
cache-to: type=local,dest=/tmp/.docker-cache | ||
load: true | ||
build-args: | | ||
DEV=1 | ||
DISTRIBUTION=22.04 | ||
ROS_DISTRO=humble | ||
ROS=ros2 | ||
target: lanelet2_src | ||
|
||
- name: Run clang formatting check | ||
run: | | ||
set -ex | ||
docker run -i --rm lanelet2_src find . -name "*.cpp" -o -name "*.h" -execdir clang-format-11 -n -Werror --style=file {} + | ||
lint: | ||
needs: formatting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup docker buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Setup docker cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.docker-cache | ||
key: ${{runner.os}}-docker-humble | ||
|
||
- name: Build dependencies | ||
uses: docker/build-push-action@v3 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
tags: lanelet2_src | ||
cache-from: type=local,src=/tmp/.docker-cache | ||
cache-to: type=local,dest=/tmp/.docker-cache | ||
load: true | ||
build-args: | | ||
DEV=1 | ||
DISTRIBUTION=22.04 | ||
ROS_DISTRO=humble | ||
ROS=ros2 | ||
target: lanelet2_src | ||
- name: Run clang-tidy | ||
run: docker run -i --rm lanelet2_src /home/developer/workspace/src/lanelet2/.github/lint.bash | ||
|
||
test: | ||
needs: formatting | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
rosdistro: [noetic, galactic, humble] | ||
include: | ||
- rosdistro: noetic | ||
os: 20.04 | ||
ros: ros | ||
- rosdistro: galactic | ||
os: 20.04 | ||
ros: ros2 | ||
- rosdistro: humble | ||
os: 22.04 | ||
ros: ros2 | ||
steps: | ||
- name: Setup docker buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Setup docker cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.docker-cache | ||
key: ${{runner.os}}-docker-${{ matrix.rosdistro }} | ||
|
||
- name: Build dependencies | ||
uses: docker/build-push-action@v3 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
tags: lanelet2_base:${{ matrix.rosdistro }} | ||
cache-from: type=local,src=/tmp/.docker-cache | ||
cache-to: type=local,dest=/tmp/.docker-cache | ||
build-args: | | ||
DEV=1 | ||
DISTRIBUTION=${{ matrix.os }} | ||
ROS_DISTRO=${{ matrix.rosdistro }} | ||
ROS=${{ matrix.ros }} | ||
target: lanelet2_deps | ||
|
||
- name: Build Lanelet2 | ||
uses: docker/build-push-action@v3 | ||
if: ${{ matrix.rosdistro == 'noetic' }} | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
tags: lanelet2:${{ matrix.rosdistro }} | ||
cache-from: type=local,src=/tmp/.docker-cache | ||
load: true | ||
build-args: | | ||
DEV=1 | ||
DISTRIBUTION=${{ matrix.os }} | ||
ROS_DISTRO=${{ matrix.rosdistro }} | ||
ROS=${{ matrix.ros }} | ||
target: lanelet2 | ||
|
||
- name: Build Lanelet2 (skip lcov) | ||
uses: docker/build-push-action@v3 | ||
if: ${{ matrix.rosdistro == 'humble' || matrix.rosdistro == 'galactic' }} | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
tags: lanelet2:${{ matrix.rosdistro }} | ||
cache-from: type=local,src=/tmp/.docker-cache | ||
load: true | ||
build-args: | | ||
DEV=0 | ||
DISTRIBUTION=${{ matrix.os }} | ||
ROS_DISTRO=${{ matrix.rosdistro }} | ||
ROS=${{ matrix.ros }} | ||
target: lanelet2 | ||
|
||
- name: Run Lanelet2 Tests | ||
run: | | ||
set -ex; | ||
if [ "${{matrix.ros}}" = "ros" ]; then | ||
export TEST_CMD="catkin build --no-status --catkin-make-args run_tests && source /opt/ros/${{matrix.rosdistro}}/setup.bash && catkin_test_results --verbose"; | ||
else | ||
export TEST_CMD="colcon test --return-code-on-test-failure"; | ||
fi; | ||
docker run -i --name lanelet2_test_${{ matrix.rosdistro }} lanelet2:${{ matrix.rosdistro }} /bin/bash -c "$TEST_CMD"; | ||
- name: Extract and Merge lcov Files | ||
if: ${{ matrix.rosdistro == 'noetic' }} | ||
run: | | ||
docker commit lanelet2_test_${{ matrix.rosdistro }} lanelet2_${{ matrix.rosdistro }}_post_run; | ||
docker run -i --name lanelet2_test_${{ matrix.rosdistro }}_lcov lanelet2_${{ matrix.rosdistro }}_post_run /home/developer/workspace/src/lanelet2/.github/lcov_merge.bash; | ||
mkdir -p ./lcov; | ||
docker cp lanelet2_test_${{ matrix.rosdistro }}_lcov:$(docker inspect --format='{{.Config.WorkingDir}}' lanelet2_test_${{ matrix.rosdistro }}_lcov)/lcov/full_coverage.lcov ./lcov/full_coverage.lcov; | ||
- name: Cleanup Docker Container | ||
run: | | ||
docker rm -f lanelet2_test_${{ matrix.rosdistro }}; | ||
docker rm -f lanelet2_test_${{ matrix.rosdistro }}_lcov; | ||
- name: Report code coverage | ||
uses: immel-f/github-actions-report-lcov@v0.1.9 | ||
if: ${{ matrix.rosdistro == 'noetic' }} | ||
with: | ||
coverage-files: ./lcov/full_coverage.lcov | ||
artifact-name: code-coverage-report | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: 'Close stale issues and PRs' | ||
on: | ||
schedule: | ||
- cron: '30 1 * * *' | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
|
||
steps: | ||
- uses: actions/stale@v6 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
stale-issue-message: 'This issue is stale because it has been open for 90 days with no activity. Is this issue still work in progress? If yes, mark it as "WIP" or comment, otherwise it will be closed in 30 days.' | ||
stale-pr-message: 'This PR is stale because it has been open for 90 days with no activity. Is this PR still work in progress? If yes, mark it as "WIP" or comment, otherwise it will be closed in 30 days.' | ||
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity.' | ||
close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity.' | ||
days-before-stale: 90 | ||
days-before-close: 30 | ||
exempt-pr-labels: 'WIP' | ||
exempt-issue-labels: 'WIP' |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
* fabian.poggenhans@kit.edu frank.bieder@kit.edu | ||
* fabian.poggenhans@kit.edu fabian.immel@kit.edu | ||
lanelet2_projection/* jan-hendrik.pauls@kit.edu |
Oops, something went wrong.
ebc31ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LCOV of commit [
ebc31ab
] during Lanelet2 CI #1File coverage rate: