-
Notifications
You must be signed in to change notification settings - Fork 4
92 lines (78 loc) · 2.42 KB
/
cpp_ci.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
name: C/C++ CI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
CTEST_OUTPUT_ON_FAILURE: 1
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: checkout googletest
run: git submodule update --init ./libraries/googletest
- name: configure_g++
run: |
CXX=g++ cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DMPP_BUILD_SHARED_LIBS=OFF \
-DMPP_ENABLE_COVERAGE=ON \
-DMPP_BUILD_FUZZER=OFF \
-DMPP_BUILD_EXAMPLE=OFF \
-DMPP_BUILD_TESTS=ON \
-DMPP_BUILD_DOCS=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=OFF \
-DMPP_SANITIZERS=ON \
-DMPP_VALGRIND=OFF \
-DMPP_BUILD_SHARED_LIBS=OFF \
-DMPP_FULL_DEBUG=ON \
-DMPP_SECURE=OFF \
-DMPP_PROFILE=OFF \
-DMPP_COLOUR=ON \
-DMPP_STATS=ON
- name: build_g++
run: |
CXX=g++ cmake --build build --config Debug --target all
- name: test_unit
run: |
cd build
ASAN_OPTIONS=detect_leaks=0 setarch `uname -m` -R ./tests/unit_tests
- name: collect code coverage
run: bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"
- name: cleanup
run: |
rm -rf ./build/
- name: configure_clang
run: |
CXX=clang++ cmake -S . -B build \
-DCMAKE_BUILD_TYPE=Release \
-DMPP_ENABLE_COVERAGE=OFF \
-DMPP_BUILD_FUZZER=ON \
-DMPP_BUILD_EXAMPLE=OFF \
-DMPP_BUILD_TESTS=OFF \
-DMPP_BUILD_DOCS=OFF \
-DCMAKE_EXPORT_COMPILE_COMMANDS=OFF \
-DMPP_SANITIZERS=ON \
-DMPP_VALGRIND=OFF \
-DMPP_BUILD_SHARED_LIBS=OFF \
-DMPP_FULL_DEBUG=ON \
-DMPP_SECURE=ON \
-DMPP_PROFILE=ON \
-DMPP_COLOUR=ON \
-DMPP_STATS=OFF
- name: build_clang
run: |
CXX=clang++ cmake --build build --config Release --target all
- name: prepare_corpus
run: |
7z x fuzzer/corpus.zip
- name: test_fuzzer
run: |
cd build
mkdir corpus && echo -ne "a1024a1024a128a0a10ddda1024a1024ddd" > ./corpus/testcase_1
FUZZ_MODE=gc ASAN_OPTIONS=detect_leaks=0 ctest --build-config Release