Skip to content

Testing

Testing #468

Workflow file for this run

name: CI
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
release:
types: [published]
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
path: 'ros_ws/src/knowrob'
- name: Setup KnowRob workspace
uses: betwo/github-setup-catkin@master
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
with:
# Version range or exact version of ROS version to use, using SemVer's version range syntax.
ros-version: noetic
# Root directory of the catkin workspace
workspace: $GITHUB_WORKSPACE/ros_ws
- name: Build KnowRob workspace
shell: bash
run: |
sudo add-apt-repository ppa:swi-prolog/stable
sudo apt-get update -y -qq
sudo apt-get install swi-prolog libspdlog-dev \
libboost-python-dev libboost-serialization-dev libboost-program-options-dev \
libraptor2-dev librdf0-dev \
libfmt-dev \
doxygen graphviz
cd ros_ws
catkin_make_isolated
- name: Run unit tests
if: github.event_name == 'push' || github.event_name == 'pull_request'
shell: bash
run: |
sudo systemctl start mongod
export ROS_HOSTNAME=localhost
roscore &
cd $GITHUB_WORKSPACE/ros_ws/src/knowrob
source $GITHUB_WORKSPACE/ros_ws/devel_isolated/setup.bash
$GITHUB_WORKSPACE/ros_ws/devel_isolated/knowrob/lib/knowrob/all_gtests --gtest_filter=* --gtest_output="xml:$GITHUB_WORKSPACE/gtest-knowrob.xml" --gtest_color=no
- name: Report test results
uses: EnricoMi/publish-unit-test-result-action@v2
if: ${{github.event_name == 'push' || github.event_name == 'pull_request'}}
with:
junit_files: "gtest-knowrob.xml"
action_fail: true
action_fail_on_inconclusive: true
#####
- name: Run doxygen
if: github.event_name == 'push' || github.event_name == 'release'
shell: bash
run: |
cd $GITHUB_WORKSPACE/ros_ws/build_isolated/knowrob
make doc
- name: Move checkout
run: |
mv $GITHUB_WORKSPACE/ros_ws/src/knowrob/.git $GITHUB_WORKSPACE/
mv $GITHUB_WORKSPACE/ros_ws/src/knowrob/* $GITHUB_WORKSPACE/
- name: Extract version tag
if: github.event_name == 'release'
shell: bash
# Extract major.minor version from tag
#run: echo "##[set-output name=doc_version;]$(echo ${GITHUB_REF#refs/tags/})"
#run: echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/tags/} | cut -d'.' -f1,2)"
run: echo "KNOWROB_DOCU_VERSION=$(echo ${GITHUB_REF#refs/tags/} | cut -d'.' -f1,2)" >> $GITHUB_ENV
#id: docu_version
- name: Extract branch name
if: github.event_name == 'push'
shell: bash
# Use branch name as version
#run: echo "##[set-output name=version;]$(echo ${GITHUB_REF#refs/heads/})"
run: echo "KNOWROB_DOCU_VERSION=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
#id: docu_version
- name: Deploy doc to gh-pages
if: github.event_name == 'push' || github.event_name == 'release'
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The branch the action should deploy to.
BRANCH: gh-pages
# The folder the action should deploy.
FOLDER: doc/html
# The folder in the target branch
# TARGET_FOLDER: ${{ steps.docu_version.outputs.version }}
TARGET_FOLDER: ${{ env.KNOWROB_DOCU_VERSION }}
CLEAN: true
SINGLE_COMMIT: true