Skip to content

Commit

Permalink
Merge branch 'workflow-updates'
Browse files Browse the repository at this point in the history
  • Loading branch information
JHartzer committed Oct 19, 2024
2 parents 21d443f + fee851f commit 36b80d2
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 49 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/all-tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: All Tests

on:
push:
branches:
- main

jobs:
build-test-document:
runs-on: ubuntu-latest
container:
image: osrf/ros:iron-desktop-full

steps:
- name: Create colcon workspace
shell: bash
run: |
apt-get update
apt-get install -y python3-colcon-common-extensions python3-colcon-lcov-result python3-rosdep git lcov cloc doxygen nodejs
mkdir -p ~/ekf_cal_ws/src
- uses: actions/checkout@v4
with:
path: 'ekf_cal_ws/src/ekf_cal'

- name: Build in ekf_cal_ws
shell: bash
working-directory: ./ekf_cal_ws
run: |
rosdep update
source /opt/ros/$ROS_DISTRO/setup.bash
rosdep install --from-paths src --ignore-src --rosdistro=$ROS_DISTRO -y
colcon build --symlink-install --packages-select ekf_cal --event-handlers console_cohesion+ --cmake-args -DCMAKE_C_FLAGS='--coverage' -DCMAKE_CXX_FLAGS='--coverage'
echo "Compile complete."
- name: Run tests
shell: bash
working-directory: ./ekf_cal_ws
run: |
source /opt/ros/$ROS_DISTRO/setup.bash
colcon test --packages-select ekf_cal --pytest-with-coverage --pytest-args --cov-report=term --event-handlers console_direct+
- name: Test Summary
uses: test-summary/action@v2
with:
paths: "./ekf_cal_ws/build/ekf_cal/test_results/ekf_cal/*.xml"
output: ./ekf_cal_ws/src/ekf_cal/docs/doxygen/html/test-summary.md
if: always()

- name: Count Lines of Code
working-directory: ./ekf_cal_ws/src/ekf_cal
shell: bash
run: |
echo 'Count Lines of Code {#cloc}\n============' > docs/software/cloc.md
cloc src eval --md | tail -n +4 >> docs/software/cloc.md
sed -i 's/--------|--------|--------|--------|--------/| | | | | |/' docs/software/cloc.md
- name: Run Doxygen
working-directory: ./ekf_cal_ws/src/ekf_cal
shell: bash
run: |
doxygen .doxyfile
- name: Generate lcov report
shell: bash
working-directory: ./ekf_cal_ws
run: |
source /opt/ros/$ROS_DISTRO/setup.bash
colcon lcov-result --packages-select ekf_cal --filter '*_test.cpp' '*_main.cpp' --lcov-config-file src/ekf_cal/.lcovrc
cp -r lcov/ ./src/ekf_cal/docs/doxygen/html/
- name: Upload Artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./ekf_cal_ws/src/ekf_cal/docs/doxygen/html

deploy-documentation:
needs: build-test-document
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
46 changes: 0 additions & 46 deletions .github/workflows/documentation.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"label": "test coverage",
"detail": "Run coverage tests of ekf_cal",
"type": "shell",
"command": "rm -r lcov; colcon test --packages-select ekf_cal --pytest-with-coverage --pytest-args --cov-report=term --event-handlers console_direct+",
"command": "rm -r lcov; rm -r ${workspaceFolder}/docs/doxygen/html/lcov; colcon test --packages-select ekf_cal --pytest-with-coverage --pytest-args --cov-report=term --event-handlers console_direct+",
"group": "test",
"problemMatcher": "$gcc",
"dependsOn": "build coverage",
Expand All @@ -53,7 +53,7 @@
"label": "report coverage",
"detail": "Generate coverage report of ekf_cal tests",
"type": "shell",
"command": "colcon lcov-result --packages-select ekf_cal --filter '*_test.cpp' '*_main.cpp' --lcov-config-file ${workspaceFolder}/.lcovrc",
"command": "colcon lcov-result --packages-select ekf_cal --filter '*_test.cpp' '*_main.cpp' --lcov-config-file ${workspaceFolder}/.lcovrc; cp -r lcov/ src/ekf_cal/docs/doxygen/html/lcov",
"group": "test",
"problemMatcher": "$gcc",
"dependsOn": "test coverage",
Expand Down
2 changes: 1 addition & 1 deletion docs/software/coverage.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
p {height:100%;}
</style>

<embed type="text/html" src="../../../../../lcov/index.html" width="95%" height="100%">
<embed type="text/html" src="lcov/index.html" width="95%" height="100%">

\endhtmlonly

0 comments on commit 36b80d2

Please sign in to comment.