-
Notifications
You must be signed in to change notification settings - Fork 27
126 lines (108 loc) · 4.11 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---
name: Build & Test
on: # NOLINT
pull_request:
push:
schedule:
- cron: '0 3 * * MON'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
container:
- image: 'ros:melodic'
env:
PYTHON_VERSION:
ROS_DISTRO: melodic
- image: 'ros:noetic'
env:
PYTHON_VERSION: 3
ROS_DISTRO: noetic
container: ${{ matrix.container }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
with:
path: src/node_example
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install ROS package dependencies
run: |
sudo apt update
sudo apt install -y git
sudo apt install -y python$PYTHON_VERSION-pip
sudo apt install -y python3-pip
sudo apt install -y python$PYTHON_VERSION-osrf-pycommon
sudo apt install -y python$PYTHON_VERSION-catkin-tools
python$PYTHON_VERSION -m pip install --upgrade pip
python3 -m pip install --upgrade pip
- name: Create workspace
run: |
cd src
wstool init
cd ..
rosdep update
rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
# Python 3 packages are needed later for Statick.
ROS_PYTHON_VERSION=3 rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO
- name: Install Statick dependencies
run: |
sudo apt update
python3 -m pip install --upgrade statick
python3 -m pip install --upgrade statick-md
sudo apt install -y cccc
sudo apt install -y clang
sudo apt install -y clang-6.0
sudo apt install -y clang-format
sudo apt install -y clang-format-6.0
sudo apt install -y clang-tidy
sudo apt install -y clang-tidy-6.0
sudo apt install -y cppcheck
sudo apt install -y file
sudo apt install -y flawfinder
sudo apt install -y libxml2
sudo apt install -y libxml2-utils
sudo apt install -y maven
sudo apt install -y python$PYTHON_VERSION-catkin-lint
sudo apt install -y python$PYTHON_VERSION-catkin-pkg
sudo apt install -y python$PYTHON_VERSION-git
sudo apt install -y python$PYTHON_VERSION-yapsy
sudo apt install -y ros-$ROS_DISTRO-roslint
sudo apt install -y uncrustify
- name: Install black (Python 3.6+)
if: contains(matrix.container.image, 'melodic') || contains(matrix.container.image, 'noetic')
run: |
python3 -m pip install --upgrade black
- name: Install node packages
run: |
npm install -g [email protected]
- name: Statick markdown
run: |
statick . --check --profile documentation.yaml --log info --timings
- name: Build workspace
if: contains(matrix.container.image, 'melodic') || contains(matrix.container.image, 'noetic')
run: |
. /opt/ros/$ROS_DISTRO/setup.bash
catkin build
- name: Statick
if: contains(matrix.container.image, 'melodic') || contains(matrix.container.image, 'noetic')
run: |
. devel/setup.bash
cp src/node_example/statick_config/rsc/_clang-format ~
statick src/node_example --check --user-paths src/node_example/statick_config --log info --timings
- name: Unit tests
run: |
sudo apt install -y lcov
. /opt/ros/$ROS_DISTRO/setup.bash
catkin config --cmake-args -DCMAKE_CXX_FLAGS="-Wall -Wno-unused --coverage -fno-inline -fno-inline-small-functions -fno-default-inline" -DCMAKE_C_FLAGS="-Wall -Wno-unused --coverage -fno-inline -fno-inline-small-functions -fno-default-inline" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXE_LINKER_FLAGS="-lgcov"
catkin build
catkin run_tests -i && catkin_test_results
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false