-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (81 loc) · 3.1 KB
/
build_and_tests.yml
File metadata and controls
83 lines (81 loc) · 3.1 KB
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
name: C++ Build & C++ Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential g++ autotools-dev libicu-dev libbz2-dev lcov libcppunit-dev software-properties-common libzmq3-dev
sudo apt-get -y --purge remove libboost*
sudo rm -rf /usr/include/boost
sudo rm -rf /usr/lib/libboost_*
- name: python3 installation
run: |
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt install python3.10 -y
sudo apt-get install libpython3.10-dev -y
sudo rm -rf /var/lib/apt/lists/*
- name: cmake installation
run: |
wget https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5.tar.gz
tar -zxvf cmake-3.22.5.tar.gz
cd cmake-3.22.5
sudo ./bootstrap
sudo make -j4
sudo make -j install
cmake --version
- name: git submodule installation
run: |
git submodule init
git submodule update
- name: boost installation
run: |
wget -O boost_1_79_0.tar.gz https://archives.boost.io/release/1.79.0/source/boost_1_79_0.tar.gz
tar xzvf boost_1_79_0.tar.gz
cd boost_1_79_0/
./bootstrap.sh --prefix=/usr/
./b2 -j4
sudo ./b2 install
- name: make project
run: |
mkdir cmake-build-debug-coverage
cd cmake-build-debug-coverage
cmake ../ -DCODE_COVERAGE=ON
cmake --build . --target unit_test --config Release -- -j
- name: run tests and get coverage
run: |
cd cmake-build-debug-coverage
./unit_test
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '*/include/*' '*/eigen/*' '*test/*' '*/googletest-src/*' -o coverage.info
COVERAGE_LINE=$(genhtml coverage.info --output-directory out | grep -Po 'lines......: \K[^%]*')
COVERAGE_FUNCTIONS=$(genhtml coverage.info --output-directory out | grep -Po 'functions..: \K[^%]*')
echo "COVERAGE_LINE=$COVERAGE_LINE" >> $GITHUB_ENV
echo "COVERAGE_FUNCTIONS=$COVERAGE_FUNCTIONS" >> $GITHUB_ENV
- name: Line coverage badge
uses: schneegans/dynamic-badges-action@v1.0.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: fcde53f4e8d03ff100637910fc249bfc
filename: treeCoreset_line__main.json
label: Line Coverage
message: ${{ env.COVERAGE_LINE }}
color: green
namedLogo: jest
- name: Branch coverage badge
uses: schneegans/dynamic-badges-action@v1.0.0
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: fcde53f4e8d03ff100637910fc249bfc
filename: treeCoreset_func__main.json
label: Function Coverage
message: ${{ env.COVERAGE_FUNCTIONS }}
color: green
namedLogo: jest