Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/install-apt-packages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'install-apt-packages'
description: 'Install necessary apt packages'
runs:
using: "composite"
steps:
- id: install-apt-packages
run: |
sudo apt -y install \
doxygen \
graphviz \
imagemagick \
python3 \
python3-pip \
python3-sphinxcontrib.spelling \
python3-venv \
software-properties-common \
wget \
libasio-dev \
libtinyxml2-dev \
clang-tidy \
curl \
grep
shell: bash
20 changes: 20 additions & 0 deletions .github/actions/install-python-packages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'install-python-packages'
description: 'Install necessary python packages'
runs:
using: "composite"
steps:
- id: install-python-packages
run: |
sudo pip3 install -U \
sphinx==3.0.3 \
doc8==0.8.0 \
sphinx_rtd_theme==0.4.3 \
sphinxcontrib.spelling==5.0.0 \
sphinxcontrib-imagehelper==1.1.1 \
colcon-common-extensions \
colcon-mixin \
vcstool \
GitPython \
setuptools \
gcovr
shell: bash
71 changes: 71 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,74 @@ jobs:
# . install/local_setup.sh
# colcon test --packages-select is-fiware --event-handlers console_direct+
# colcon test-result

uncrustify:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
with:
path: src/integration-service

- name: Fetch all branches and tags
run: |
cd src/integration-service
git fetch --prune --unshallow

- uses: ./src/integration-service/.github/actions/install-apt-packages
- uses: ./src/integration-service/.github/actions/install-python-packages

- name: Install uncrustify
run: |
git clone https://github.com/uncrustify/uncrustify.git \
--branch uncrustify-0.71.0 \
--single-branch uncrustify
mkdir -p uncrustify/build
cd uncrustify/build
cmake ..
sudo cmake --build . --target install
cd ../..
sudo rm -rf uncrustify

- name: Clone ament_lint
run: |
git clone https://github.com/ament/ament_lint.git src/ament_lint

- name: Build ament_uncrustify
run: colcon build --packages-up-to ament_uncrustify

- name: Fetch uncrustify config file
run: |
curl \
-l https://raw.githubusercontent.com/eProsima/cpp-style/master/uncrustify.cfg \
-o uncrustify.cfg

- name: Get difference
run: |
cd src/integration-service
echo "MODIFIED_FILES=$(git diff --name-only origin/${GITHUB_BASE_REF} origin/${GITHUB_HEAD_REF} | grep -e '\.h' -e '\.hpp' -e '\.cpp' | tr '\n' ' ')" >> $GITHUB_ENV

- name: Check difference
run: |
cd src/integration-service
if [[ -z "${MODIFIED_FILES}" ]]
then
touch empty.hpp
echo "MODIFIED_FILES=empty.hpp" >> $GITHUB_ENV
fi

- name: Check style
run: |
source install/local_setup.bash
cd src/integration-service
ament_uncrustify \
-c ../../uncrustify.cfg \
--language CPP \
--xunit-file ../../uncrustify_results.xml \
${MODIFIED_FILES}

- name: Upload uncrustify results
uses: actions/upload-artifact@v1
with:
name: uncrustify_results
path: uncrustify_results.xml
4 changes: 2 additions & 2 deletions core/src/utils/Log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ Logger& Logger::operator <<(

//==============================================================================
Logger& Logger::operator <<(
std::basic_ostream<char, std::char_traits<char> >&
std::basic_ostream<char, std::char_traits<char>>&
(*func)(
std::basic_ostream<char, std::char_traits<char> >&))
std::basic_ostream<char, std::char_traits<char>>&))
{
switch (_status)
{
Expand Down