Skip to content

Commit

Permalink
Add Coverage (#2)
Browse files Browse the repository at this point in the history
Co-authored-by: seskibinski <[email protected]>
  • Loading branch information
Leon0402 and seskibinski authored Sep 29, 2023
1 parent 6752bea commit d37f305
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ name: Rail Horizon Documentation
on:
push:
branches:
# - main
- '**'
- main

permissions:
contents: write
Expand Down
30 changes: 16 additions & 14 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,19 @@ on:
- '**'

env:
GOPRIVATE: github.com/DSD-DBS/*
DB_MAP_VERSION: 12
DB_MAP_ENDPOINT: DB_LAN
DB_MAP_CATALOG: validate.s4r2.oss.4
PERSISTENT_STORAGE_ROOT_DIR: ./hdmap
PERSISTENT_STORAGE_ROOT_DIR: ${{ github.workspace }}/map_data
RMW_IMPLEMENTATION: rmw_fastrtps_cpp

jobs:
build:
runs-on: ubuntu-22.04

defaults:
run:
shell: bash

steps:

- name: Checkout Rail Horizon code including submodules recursively
uses: actions/checkout@v3
with:
Expand All @@ -51,20 +47,26 @@ jobs:
- name: Build Rail Horizon
run: |
source /opt/ros/humble/setup.bash
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
colcon build --base-paths src --cmake-args -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON --event-handlers console_cohesion+ --packages-up-to dsd_rail_horizon
colcon build --base-paths src --cmake-args -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=ON --event-handlers console_cohesion+ --packages-up-to dsd_mission_profile
- name: Run tests
run: |
source /opt/ros/humble/setup.bash && source ./install/local_setup.bash
export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
colcon test --packages-select dsd_rail_horizon_core dsd_mission_profile --return-code-on-test-failure --ctest-arg -E "overTheAirUpdateIsSucessfull"
colcon test --packages-select dsd_rail_horizon dsd_rail_horizon_core dsd_mission_profile --ctest-arg -E "overTheAirUpdateIsSucessfull"
- name: Upload build files
if: success() || failure()
uses: actions/upload-artifact@v3
- name: Print test results
run: |
source /opt/ros/humble/setup.bash && source ./install/local_setup.bash
colcon test-result --verbose --all
- name: Run code coverage
run: |
gcovr --exclude-unreachable-branches --exclude-throw-branches -r . --filter src/ --exclude '.*tests/' --xml ${{github.workspace}}/build/coverage.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
name: build-folder
path: |
build
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{github.workspace}}/build/coverage.xml
fail_ci_if_error: true
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
~ SPDX-License-Identifier: CC0-1.0
-->

[![Rail Horizon Build](https://github.com/DSD-DBS/rail-horizon-oss/actions/workflows/main.yml/badge.svg)](https://github.com/DSD-DBS/rail-horizon-oss/actions/workflows/main.yml) [![Rail Horizon Documentation](https://github.com/DSD-DBS/rail-horizon-oss/actions/workflows/documentation.yml/badge.svg)](https://github.com/DSD-DBS/rail-horizon-oss/actions/workflows/documentation.yml)
[![Rail Horizon Build](https://github.com/DSD-DBS/rail-horizon-oss/actions/workflows/main.yml/badge.svg)](https://github.com/DSD-DBS/rail-horizon-oss/actions/workflows/main.yml) [![Rail Horizon Documentation](https://github.com/DSD-DBS/rail-horizon-oss/actions/workflows/documentation.yml/badge.svg)](https://github.com/DSD-DBS/rail-horizon-oss/actions/workflows/documentation.yml) [![codecov](https://codecov.io/github/DSD-DBS/rail-horizon-oss/graph/badge.svg?token=8AZSXJ7HPF)](https://codecov.io/github/DSD-DBS/rail-horizon-oss)

# Rail Horizon

Expand Down

0 comments on commit d37f305

Please sign in to comment.