-
Notifications
You must be signed in to change notification settings - Fork 53
88 lines (74 loc) · 2.65 KB
/
push.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
# SPDX-FileCopyrightText: 2021 Comcast Cable Communications Management, LLC
# SPDX-License-Identifier: Apache-2.0
name: CI
on:
pull_request_target:
push:
paths-ignore:
- 'AUTHORS'
- 'LICENSE'
- 'NOTICE'
- '**.md'
- '.gitignore'
tags-ignore:
- 'v[0-9]+.[0-9]+.[0-9]+'
branches:
- main
- master
jobs:
test:
name: Unit Tests
runs-on: [ ubuntu-20.04 ]
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
with:
fetch-depth: 0
# Install the dependent packages
- name: Install packages
run: |
sudo apt update
sudo apt-get -y install valgrind libcunit1 libcunit1-doc libcunit1-dev libmsgpack-dev gcovr libtool
pip install coverage
- name: Make Build Directory
run: mkdir build
- name: Get Sonarcloud Binaries
uses: sonarsource/sonarcloud-github-c-cpp@v2
- name: CMake
working-directory: build
run: |
cmake .. -DBUILD_GIT:BOOL=true -DENABLE_WEBCFGBIN:BOOL=true -DINTEGRATION_TESTING:BOOL=false -DDISABLE_VALGRIND:BOOL=${DISABLE_VALGRIND} -DENABLE_SESHAT:BOOL=true -DFEATURE_DNS_QUERY:BOOL=true -DPARODUS_SECERT_ENABLE:BOOL=true
- name: Get rtrouted Binary
working-directory: build
run: |
../.github/scripts/rtrouted.sh
- name: Build
working-directory: build
run: |
ps aux
export RBUS_ROOT=${HOME}/rbus
export RBUS_INSTALL_DIR=${RBUS_ROOT}/install && \
export LD_LIBRARY_PATH=${RBUS_INSTALL_DIR}/usr/lib/rbus_temp_lib:${LD_LIBRARY_PATH}
export C_INCLUDE_PATH=${RBUS_INSTALL_DIR}/usr/include:${RBUS_INSTALL_DIR}/usr/include/rbus
mkdir _install
mkdir _install/lib
cp ${RBUS_INSTALL_DIR}/usr/lib/librbus* _install/lib
build-wrapper-linux-x86-64 --out-dir bw-output make all test
- name: Stop rtrouted
run: |
killall -9 rtrouted
- name: Merge GCOV Reports for Sonarcloud
working-directory: build
run: |
gcovr --sonarqube coverage.xml -r ..
- name: Upload SonarCloud
run: |
sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dproject.settings=.sonar-project.properties -Dsonar.login=${{ secrets.SONAR_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Codecov.io
uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3.1.4
with:
directory: .
flags: unittests
fail_ci_if_error: true