11name : CI Checks
22
3+ env :
4+ bashPass : \033[32;1mPASSED -
5+ bashInfo : \033[33;1mINFO -
6+ bashFail : \033[31;1mFAILED -
7+ bashEnd : \033[0m
8+
39on :
410 push :
511 branches : ["**"]
@@ -24,25 +30,30 @@ jobs:
2430 -DUNIT_TESTS=0 \
2531 -DCMAKE_C_FLAGS="${CFLAGS}"
2632 make -C build/ all
33+
2734 - name : Integration Tests
28- run : |
29- cd build/
30- ctest --output-on-failure | tee -a $GITHUB_STEP_SUMMARY
35+ run : ctest --test-dir build --output-on-failure | tee -a $GITHUB_STEP_SUMMARY
36+
3137 - name : Archive Test Results
3238 if : success() || failure()
3339 uses : actions/upload-artifact@v3
3440 with :
35- name : system_test_results
36- path : |
37- build/Testing/Temporary/LastTest.log
41+ name : system_test_results
42+ path : |
43+ build/Testing/Temporary/LastTest.log
3844
3945 unit-tests-with-sanitizer :
4046 runs-on : ubuntu-latest
4147 steps :
4248 - name : Clone This Repo
4349 uses : actions/checkout@v3
44- - name : Build
50+
51+ - env :
52+ stepName : Build corePKCS11 Sanitizer Unit Tests
4553 run : |
54+ # ${{ env.stepName }}
55+ echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
56+
4657 CFLAGS="-Wall -Wextra -DNDEBUG"
4758 CFLAGS+=" -fsanitize=address,undefined"
4859 cmake -S test -B build/ \
@@ -52,18 +63,25 @@ jobs:
5263 -DSYSTEM_TESTS=0 \
5364 -DCMAKE_C_FLAGS="${CFLAGS}"
5465 make -C build/ all
55- - name : Unit Tests
56- run : |
57- cd build/
58- ctest --output-on-failure | tee -a $GITHUB_STEP_SUMMARY
66+ echo "::endgroup::"
67+
68+ echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}"
69+
70+ - name : Run Unit Tests
71+ run : ctest --test-dir build --output-on-failure | tee -a $GITHUB_STEP_SUMMARY
5972
6073 unit-tests :
6174 runs-on : ubuntu-latest
6275 steps :
6376 - name : Clone This Repo
6477 uses : actions/checkout@v3
65- - name : Build
78+
79+ - env :
80+ stepName : Build corePKCS11 Unit Tests
6681 run : |
82+ # ${{ env.stepName }}
83+ echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
84+
6785 sudo apt-get install -y lcov
6886 CFLAGS="--coverage -Wall -Wextra -DNDEBUG"
6987 cmake -S test -B build/ \
@@ -73,30 +91,41 @@ jobs:
7391 -DSYSTEM_TESTS=0 \
7492 -DCMAKE_C_FLAGS="${CFLAGS}"
7593 make -C build/ all
94+ echo "::endgroup::"
95+
96+ echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}"
97+
7698 - name : Run Unit Tests
99+ run : ctest --test-dir build --output-on-failure | tee -a $GITHUB_STEP_SUMMARY
100+
101+ - env :
102+ stepName : Line and Branch Coverage Build
77103 run : |
78- cd build/
79- ctest --output-on-failure | tee -a $GITHUB_STEP_SUMMARY
80- cd ..
81- - name : Run and Collect Coverage
82- if : success() || failure()
83- run : |
104+ # ${{ env.stepName }}
105+ echo -e "::group::${{ env.bashInfo }} Build Coverage Target ${{ env.bashEnd }}"
106+
107+ # Build the coverage target
84108 make -C build/ coverage
85- lcov --rc lcov_branch_coverage=1 --remove build/coverage.info '*test*' --output-file build/coverage.info
86- lcov --rc lcov_branch_coverage=1 --remove build/coverage.info '*CMakeCCompilerId*' --output-file build/coverage.info
87- lcov --rc lcov_branch_coverage=1 --remove build/coverage.info '*mocks*' --output-file build/coverage.info
109+
110+ # Generate coverage report, excluding extra directories
111+ lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info '*test*' '*CMakeCCompilerId*' '*mocks*'
112+ echo "::endgroup::"
113+
88114 lcov --list build/coverage.info
115+ echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}"
116+
89117 - name : Archive Test Results
90118 if : success() || failure()
91119 uses : actions/upload-artifact@v3
92120 with :
93- name : unit_test_results
94- path : |
95- build/utest_report.txt
96- build/*_out.txt
97- build/coverage.info
98- build/report.xml
99- build/Testing/Temporary/LastTest.log
121+ name : unit_test_results
122+ path : |
123+ build/utest_report.txt
124+ build/*_out.txt
125+ build/coverage.info
126+ build/report.xml
127+ build/Testing/Temporary/LastTest.log
128+
100129 - name : Upload coverage data to Codecov
101130 if : success()
102131 uses : codecov/codecov-action@v3
@@ -106,7 +135,6 @@ jobs:
106135 fail_ci_if_error : false
107136 verbose : false
108137
109-
110138 complexity :
111139 runs-on : ubuntu-latest
112140 steps :
@@ -129,34 +157,12 @@ jobs:
129157 spell-check :
130158 runs-on : ubuntu-latest
131159 steps :
132- - name : Checkout Parent Repo
133- uses : actions/checkout@v3
134- with :
135- ref : main
136- repository : aws/aws-iot-device-sdk-embedded-C
137- - run : rm -r libraries/standard/corePKCS11
138160 - name : Clone This Repo
139161 uses : actions/checkout@v3
162+ - name : Run spellings check
163+ uses : FreeRTOS/CI-CD-Github-Actions/spellings@main
140164 with :
141- path : libraries/standard/corePKCS11
142- - name : Install spell
143- run : |
144- sudo apt-get install spell
145- sudo apt-get install util-linux
146- - name : Check spelling
147- run : |
148- PATH=$PATH:$PWD/tools/spell
149- # Modifies `find` command used in spell checker to ignore the test and dependency directory
150- # The command looks like this `extract-comments `find $DIRNAME -name \*.[ch]` should the line change and the sed command will
151- # append "-not path {val added below}" for each of the directories mentioned.
152- # https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/ad28ed355df4f82b77f48028e24bd6fc9e63bc54/tools/spell/find-unknown-comment-words#L86
153- sed -i 's/find $DIRNAME/find $DIRNAME -not -path '*test*' -not -path '*dependency*'/g' tools/spell/find-unknown-comment-words
154- find-unknown-comment-words --directory libraries/standard/corePKCS11
155- if [ "$?" = "0" ]; then
156- exit 0
157- else
158- exit 1
159- fi
165+ path : ./
160166
161167 formatting :
162168 runs-on : ubuntu-20.04
@@ -172,16 +178,24 @@ jobs:
172178 runs-on : ubuntu-latest
173179 steps :
174180 - uses : actions/checkout@v3
175- - name : Setup Python for link verifier action
176- uses : actions/setup-python@v4
177- with :
178- python-version : ' 3.11.0'
179181 - name : Check Links
180- uses : FreeRTOS/CI-CD-GitHub-Actions/link-verifier@main
182+ uses : FreeRTOS/CI-CD-Github-Actions/link-verifier@main
183+ with :
184+ path : ./
185+
186+ verify-manifest :
187+ runs-on : ubuntu-latest
188+ steps :
189+ - uses : actions/checkout@v3
190+ with :
191+ submodules : true
192+ fetch-depth : 0
193+
194+ - name : Run manifest verifier
195+ uses : FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@main
181196 with :
182197 path : ./
183- exclude-dirs : cbmc
184- include-file-types : .c,.h,.dox
198+ fail-on-incorrect-version : true
185199
186200 git-secrets :
187201 runs-on : ubuntu-latest
@@ -215,14 +229,15 @@ jobs:
215229 - name : Install Python3
216230 uses : actions/setup-python@v4
217231 with :
218- python-version : ' 3.11.0'
232+ python-version : " 3.11.0"
219233 - name : Measure sizes
220234 uses : FreeRTOS/CI-CD-Github-Actions/memory_statistics@main
221235 with :
222- config : .github/memory_statistics_config.json
223- check_against : docs/doxygen/include/size_table.md
236+ config : .github/memory_statistics_config.json
237+ check_against : docs/doxygen/include/size_table.md
224238
225239 proof_ci :
240+ if : ${{ github.event.pull_request }}
226241 runs-on : cbmc_ubuntu-latest_16-core
227242 steps :
228243 - name : Set up CBMC runner
0 commit comments