@@ -13,29 +13,47 @@ jobs:
13
13
steps :
14
14
- name : Clone This Repo
15
15
uses : actions/checkout@v2
16
- - name : Build
16
+ - name : Build Project
17
17
run : |
18
- sudo apt-get install -y lcov
19
- cmake -S test -B build/ \
18
+ CFLAGS=" --coverage -O0 -Wall -Wextra -Werror"
19
+ CFLAGS+=" -DFORTIFY_SOURCE=1"
20
+ CFLAGS+=" -fsanitize=address"
21
+ CFLAGS+=" -fsanitize=pointer-compare -fsanitize=pointer-subtract"
22
+ CFLAGS+=" -fsanitize=undefined"
23
+ CFLAGS+=" -fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero,bounds-strict"
24
+ cmake -S test -B build \
20
25
-G "Unix Makefiles" \
21
26
-DCMAKE_BUILD_TYPE=Debug \
22
- -DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG'
23
- make -C build/ all
24
- - name : Test
27
+ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
28
+ -DCMAKE_C_FLAGS="$CFLAGS"
29
+ make -C build all
30
+ - name : Run with Address Sanitizer
25
31
run : |
26
- cd build/
32
+ pushd build
27
33
ctest -E system --output-on-failure
28
- cd ..
29
- - name : Run Coverage
34
+ make coverage
35
+ popd
36
+ - name : Test for Coverage
30
37
run : |
31
- make -C build/ coverage
38
+ sudo apt-get install -y lcov
39
+ CFLAGS=" --coverage -O0 -Wall -Wextra -Werror"
40
+ CFLAGS+=" -DFORTIFY_SOURCE=0"
41
+ CFLAGS+=" -DNDEBUG"
42
+ cmake -S test -B build_cov \
43
+ -G "Unix Makefiles" \
44
+ -DCMAKE_BUILD_TYPE=Debug \
45
+ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \
46
+ -DCMAKE_C_FLAGS="$CFLAGS"
47
+ make -C build_cov coverage
32
48
declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*3rdparty\*")
33
- echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build /coverage.info -o build /coverage.info
34
- lcov --rc lcov_branch_coverage=1 --list build /coverage.info
49
+ echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build_cov /coverage.info -o build_cov /coverage.info
50
+ lcov --rc lcov_branch_coverage=1 --list build_cov /coverage.info
35
51
- name : Check Coverage
36
52
uses : FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
37
53
with :
38
- path : ./build/coverage.info
54
+ line-coverage-min : 100
55
+ branch-coverage-min : 100
56
+ path : ./build_cov/coverage.info
39
57
complexity :
40
58
runs-on : ubuntu-latest
41
59
steps :
@@ -118,7 +136,7 @@ jobs:
118
136
- name : Install Python3
119
137
uses : actions/setup-python@v2
120
138
with :
121
- python-version : ' 3.7.10 '
139
+ python-version : ' 3.8 '
122
140
- name : Measure sizes
123
141
uses : FreeRTOS/CI-CD-Github-Actions/memory_statistics@main
124
142
with :
0 commit comments