Skip to content

Commit 508651c

Browse files
authored
CI CD Update (#105)
* Onboard to CI-CD Workflows * Use ubuntu latest for CBMC now that the default runner is multicore. * Fix broken link in CBMC proofs * Add the path to the manifest file * Ignore the coreMQTT source files in the coverage check * Add CMock to the manifest * Exclude 'dependency' instead of 'coreMQTT' as that match didn't work * Recurse submodules when doing doxygen as coreMQTT is needed for the doxygen output * Apply formatting changes * Remove trailing slash in CBMC proof url * Use the github hosted MQTT doxygen to see if that fixes the issue * Add the removed step to the workflow to download the tag, revert the doxyfile change
1 parent d3668a6 commit 508651c

File tree

29 files changed

+364
-342
lines changed

29 files changed

+364
-342
lines changed

.github/.cSpellWords.txt

Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
ACKS
2+
Ack
3+
CBMC
4+
CBOR
5+
CMOCK
6+
CMock
7+
CONNACK
8+
COVERITY
9+
CSDK
10+
CTest
11+
CmdCompleteCallback
12+
Cmock
13+
Coverity
14+
DCMOCK
15+
DECIHOURS
16+
DNDEBUG
17+
DOXYGEN
18+
DUNITY
19+
DUP
20+
Decihours
21+
Deserialized
22+
Doxygen
23+
FuncToTest
24+
Init
25+
LWT
26+
MISRA
27+
MQTT
28+
MQTT's
29+
MQTTAgentCommandFunc
30+
MQTTAgentCommandFuncReturns
31+
MQTTAgentConnectArgs
32+
MQTTAgentSubscribeArgs
33+
MQTTGetCurrentTimeFunc
34+
MQTTQoS
35+
MQTTRecvFailed
36+
Misra
37+
Mqtt
38+
NONDET
39+
NUM
40+
Nondet
41+
POSIX
42+
PUBACK
43+
PUBLISHes
44+
QOS
45+
QoS
46+
Qos
47+
RECV
48+
SDK
49+
STDC
50+
SUBACK
51+
SUBACK's
52+
SYSCLK
53+
SYSCLOCK
54+
SYSClk
55+
Struct
56+
SysClk
57+
SysClock
58+
Sysclk
59+
Sysclock
60+
TODO
61+
UNACKED
62+
UNPADDED
63+
UNSUB
64+
UNSUBACK
65+
Unpadded
66+
Unprotect
67+
Unprotected
68+
Unsub
69+
VECT
70+
Vect
71+
Wunused
72+
ack
73+
acked
74+
acknowledgement
75+
acknowledgements
76+
acks
77+
args
78+
bool
79+
br
80+
bytesToRecv
81+
cbmc
82+
cbor
83+
cmdCompleteCallback
84+
cmdCompleteCb
85+
cmock
86+
connectArgs
87+
connectCmdCallback
88+
connectionArgs
89+
const
90+
coremqtt
91+
coverity
92+
ctest
93+
ctestACK
94+
decihours
95+
deserialized
96+
disconnectCmdCallback
97+
doxygen
98+
dup
99+
endcond
100+
enqueue
101+
enqueued
102+
enqueueing
103+
enqueues
104+
enum
105+
enums
106+
func
107+
getpacketid
108+
hu
109+
ifndef
110+
init
111+
initalized
112+
initializers
113+
isystem
114+
lcov
115+
lwt
116+
memset
117+
messagectx
118+
messagerecv
119+
misra
120+
mqtt
121+
mypy
122+
networkRecv
123+
nondet
124+
numSubscriptions
125+
pAckInfo
126+
pArgs
127+
pCmdCallbackContext
128+
pCmdCompleteCallbackContext
129+
pCmdContext
130+
pConnectArgs
131+
pDeserializedInfo
132+
pFuncName
133+
pMqttInfoParam
134+
pMsgCtx
135+
pMsgInterface
136+
pParams
137+
pPendingAcks
138+
pPublishArg
139+
pSubackCodes
140+
pSubscribeArgs
141+
pSubscriptionArgs
142+
pUnusedArg
143+
pVoidConnectArgs
144+
pVoidSubscribeArgs
145+
params
146+
pendingAcks
147+
preprocessor
148+
printf
149+
publishCmdCompleteCb
150+
pylint
151+
pytest
152+
pyyaml
153+
qos
154+
recv
155+
sinclude
156+
strlen
157+
struct
158+
structs
159+
suback
160+
subscribeArgs
161+
subscribeCmdCompleteCb
162+
sysclk
163+
sysclock
164+
th
165+
uint
166+
unpadded
167+
unprotect
168+
unsubscribeArgs
169+
unsubscribeCmdCompleteCb
170+
unsubscriptions
171+
utest
172+
vect
173+
writev
174+
xlarge

.github/workflows/ci.yml

Lines changed: 105 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: 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+
39
on:
410
push:
511
branches: ["**"]
@@ -12,78 +18,112 @@ jobs:
1218
runs-on: ubuntu-latest
1319
steps:
1420
- name: Clone This Repo
15-
uses: actions/checkout@v2
21+
uses: actions/checkout@v3
1622
with:
1723
submodules: recursive
18-
- name: Build
24+
25+
- name: Perform Recursive Clone
26+
shell: bash
27+
run: git submodule update --checkout --init --recursive
28+
29+
- env:
30+
stepName: Build CoreMQTT
1931
run: |
32+
# ${{ env.stepName }}
33+
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
34+
2035
sudo apt-get install -y lcov
2136
cmake -S test -B build/ \
2237
-G "Unix Makefiles" \
2338
-DCMAKE_BUILD_TYPE=Debug \
2439
-DBUILD_CLONE_SUBMODULES=ON \
2540
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG'
2641
make -C build/ all
27-
- name: Test
28-
run: |
29-
cd build/
30-
ctest -E system --output-on-failure
31-
cd ..
32-
- name: Run Coverage
42+
43+
echo "::endgroup::"
44+
echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}"
45+
46+
- name: Run Tests
47+
run: ctest --test-dir build -E system --output-on-failure
48+
49+
- env:
50+
stepName: Line and Branch Coverage Build
3351
run: |
52+
# ${{ env.stepName }}
53+
echo -e "::group::${{ env.bashInfo }} Build Coverage Target ${{ env.bashEnd }}"
54+
# Build the coverage target
3455
make -C build/ coverage
35-
declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*dependency\*")
36-
echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info
56+
57+
echo -e "::group::${{ env.bashInfo }} Generate Coverage Report ${{ env.bashEnd }}"
58+
# Generate coverage report, excluding extra directories
59+
lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info '*test*' '*CMakeCCompilerId*' '*mocks*' '*dependency*'
60+
61+
echo "::endgroup::"
3762
lcov --rc lcov_branch_coverage=1 --list build/coverage.info
63+
echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}"
64+
3865
- name: Check Coverage
3966
uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
4067
with:
41-
path: ./build/coverage.info
68+
coverage-file: ./build/coverage.info
69+
4270
complexity:
4371
runs-on: ubuntu-latest
4472
steps:
45-
- uses: actions/checkout@v2
73+
- uses: actions/checkout@v3
4674
- name: Check complexity
4775
uses: FreeRTOS/CI-CD-Github-Actions/complexity@main
4876
with:
4977
path: ./
78+
horrid_threshold: 12
79+
5080
doxygen:
5181
runs-on: ubuntu-latest
5282
steps:
53-
- uses: actions/checkout@v2
54-
- name: Download MQTT tag
83+
- uses: actions/checkout@v3
84+
85+
- env:
86+
stepName: Download MQTT tag
87+
name: ${{ env.stepName }}
5588
run: |
5689
# We don't need to generate the coreMQTT docs, we only need the tag file. We can just download it.
90+
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
5791
mkdir -p source/dependency/coreMQTT/docs/doxygen/output
5892
wget -O source/dependency/coreMQTT/docs/doxygen/output/mqtt.tag \
5993
"https://freertos.org/Documentation/api-ref/coreMQTT/docs/doxygen/output/mqtt.tag"
94+
echo -e "::endgroup::"
95+
echo -e "${{env.bashPass}} ${{ env.stepName }} ${{ env.bashEnd }}"
96+
6097
- name: Run doxygen build
6198
uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main
6299
with:
63100
path: ./
101+
64102
spell-check:
65103
runs-on: ubuntu-latest
66104
steps:
67105
- name: Clone This Repo
68-
uses: actions/checkout@v2
106+
uses: actions/checkout@v3
69107
- name: Run spellings check
70108
uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
71109
with:
72110
path: ./
111+
73112
formatting:
74-
runs-on: ubuntu-latest
113+
runs-on: ubuntu-20.04
75114
steps:
76-
- uses: actions/checkout@v2
115+
- uses: actions/checkout@v3
77116
- name: Check formatting
78117
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
79118
with:
80119
path: ./
120+
81121
git-secrets:
82122
runs-on: ubuntu-latest
83123
steps:
84-
- uses: actions/checkout@v2
124+
- uses: actions/checkout@v3
85125
- name: Checkout awslabs/git-secrets
86-
uses: actions/checkout@v2
126+
uses: actions/checkout@v3
87127
with:
88128
repository: awslabs/git-secrets
89129
ref: master
@@ -94,23 +134,66 @@ jobs:
94134
run: |
95135
git-secrets --register-aws
96136
git-secrets --scan
137+
97138
memory_statistics:
98139
runs-on: ubuntu-latest
99140
steps:
100-
- uses: actions/checkout@v2
141+
- uses: actions/checkout@v3
142+
with:
143+
submodules: 'recursive'
144+
145+
- name: Install Python3
146+
uses: actions/setup-python@v3
101147
with:
102-
submodules: 'recursive'
148+
python-version: '3.11.0'
149+
103150
- name: Measure sizes
104151
uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main
105152
with:
106153
config: .github/memory_statistics_config.json
107154
check_against: docs/doxygen/include/size_table.md
155+
156+
157+
link-verifier:
158+
runs-on: ubuntu-latest
159+
steps:
160+
- uses: actions/checkout@v3
161+
- name: Check Links
162+
env:
163+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
164+
uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main
165+
with:
166+
path: ./
167+
168+
169+
verify-manifest:
170+
runs-on: ubuntu-latest
171+
steps:
172+
- uses: actions/checkout@v3
173+
with:
174+
submodules: true
175+
fetch-depth: 0
176+
177+
# At time of writing the gitmodules are set not to pull
178+
# Even when using fetch submodules. Need to run this command
179+
# To force it to grab them.
180+
- name: Perform Recursive Clone
181+
shell: bash
182+
run: git submodule update --checkout --init --recursive
183+
184+
- name: Run manifest verifier
185+
uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@CI-CD-Overhaul
186+
with:
187+
path: ./
188+
fail-on-incorrect-version: true
189+
108190
proof_ci:
109-
runs-on: cbmc_ubuntu-latest_64-core
191+
runs-on: ubuntu-latest
110192
steps:
111193
- name: Set up CBMC runner
112194
uses: FreeRTOS/CI-CD-Github-Actions/set_up_cbmc_runner@main
113195
- name: Run CBMC
114196
uses: FreeRTOS/CI-CD-Github-Actions/run_cbmc@main
115197
with:
116198
proofs_dir: test/cbmc/proofs
199+

0 commit comments

Comments
 (0)