mirror of
https://github.com/emqx/neuron.git
synced 2026-10-17 04:40:42 +08:00
152 lines
4.1 KiB
YAML
152 lines
4.1 KiB
YAML
name: check
|
|
|
|
on:
|
|
push:
|
|
pull_request:
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
jobs:
|
|
clang_format_check:
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
|
# checkout
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Run clang-format style check for C/C++ programs.
|
|
uses: DoozyX/clang-format-lint-action@v0.12
|
|
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@v4
|
|
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-main
|
|
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
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/ut/reports/ut.log --output-junit tests/ut/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/ut/reports/ut.log
|
|
build/tests/ut/reports/output.xml
|
|
build/result/index.html
|
|
build/neuron.log
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
gcov: true
|
|
fail_ci_if_error: true
|
|
gcov_include: include plugins src
|
|
gcov_ignore: tests simulator
|
|
|
|
ft:
|
|
runs-on: ubuntu-20.04
|
|
container: ghcr.io/neugates/build:x86_64-main
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
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: 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
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
gcov: true
|
|
gcov_include: include plugins src
|
|
gcov_ignore: tests simulator
|
|
|
|
pft:
|
|
runs-on: ubuntu-20.04
|
|
container: ghcr.io/neugates/build:x86_64-main
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
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: function test
|
|
run: |
|
|
pip install -U pytest
|
|
pip install requests
|
|
pytest -s tests/ft
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
gcov: true
|
|
gcov_include: include plugins src
|
|
gcov_ignore: tests simulator
|