-
Notifications
You must be signed in to change notification settings - Fork 233
156 lines (131 loc) · 4.25 KB
/
check.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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: check
on:
push:
pull_request:
release:
types:
- published
jobs:
clang_format_check:
runs-on: ubuntu-20.04
steps:
# checkout
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Run clang-format style check for C/C++ programs.
uses: DoozyX/[email protected]
with:
source: 'src plugins include tests'
exclude: 'include/neuron/utils/uthash.h include/neuron/utils/utarray.h include/neuron/utils/utlist.h include/neuron/utils/zlog.h'
clangFormatVersion: 10
style: file
cppcheck:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: cppcheck
run: |
sudo apt install cppcheck
cppcheck --enable=all --error-exitcode=2 --inline-suppr --suppress=missingInclude --suppress=unusedFunction ./plugins ./simulator ./src
ut:
runs-on: ubuntu-20.04
container: ghcr.io/neugates/build:x86_64-v2.6
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: compile
run: |
git config --global --add safe.directory $(pwd)
mkdir -p build && cd build
cmake -DUSE_GCOV=1 .. -DCMAKE_TOOLCHAIN_FILE=../cmake/x86_64-linux-gnu.cmake
make -j4
- name: unit test
run: |
cd build
sudo apt-get update
sudo apt install -y lcov
ctest --output-on-failure -O tests/reports/ut.log --output-junit tests/reports/output.xml
lcov --capture --directory . --output-file testneuron.info --test-name testneuron
genhtml -o result testneuron.info
- uses: actions/upload-artifact@v3
with:
name: ut_result
path: |
build/tests/reports/ut.log
build/tests/reports/output.xml
build/result/index.html
build/neuron.log
ft:
runs-on: ubuntu-20.04
container: ghcr.io/neugates/build:x86_64-v2.6
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: compile
run: |
git config --global --add safe.directory $(pwd)
mkdir -p build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/x86_64-linux-gnu.cmake
make -j4
- name: function test
run: |
sudo apt-get install -y mosquitto
mosquitto -v &
python3 -m pip install -U pip
python3 -m pip install -r ft/requirements.txt
python3 -m robot --maxerrorlines=600 -P ft/ -d ft/reports ft
- uses: actions/upload-artifact@v3
with:
name: ft_result
path: |
ft/reports/log.html
ft/reports/output.xml
ft/reports/report.html
build/neuron.log
pyft:
runs-on: ubuntu-20.04
container: ghcr.io/neugates/build:x86_64-v2.6
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: compile
run: |
git config --global --add safe.directory $(pwd)
mkdir -p build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/x86_64-linux-gnu.cmake
make -j4
- name: get neuron current branch
shell: bash
run: |
if [ '${{ github.event_name }}' == 'push' ]; then
branch=${{ github.ref_name }}
elif [ '${{ github.event_name }}' == 'pull_request' ]; then
branch=${{ github.event.pull_request.base.ref }}
elif [ '${{ github.event_name }}' == 'release' ]; then
branch=${{ github.event.release.target_commitish }}
fi
echo "BRANCH=$branch" >> $GITHUB_ENV
echo "neuron current branch is $branch"
- name: fetch neu-ft
uses: actions/checkout@v2
with:
repository: neugates/neu-ft
path: neu-ft
ref: ${{ env.BRANCH }}
- name: function test
run: |
pip install -U pytest
pip install requests
pytest -s neu-ft/neuron
- uses: actions/upload-artifact@v3
with:
name: pyft_result
path: |
neu-ft/neuron/report