Skip to content

Commit

Permalink
CI CD Update (#105)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Skptak committed Jan 29, 2024
1 parent d3668a6 commit 508651c
Show file tree
Hide file tree
Showing 29 changed files with 364 additions and 342 deletions.
174 changes: 174 additions & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
ACKS
Ack
CBMC
CBOR
CMOCK
CMock
CONNACK
COVERITY
CSDK
CTest
CmdCompleteCallback
Cmock
Coverity
DCMOCK
DECIHOURS
DNDEBUG
DOXYGEN
DUNITY
DUP
Decihours
Deserialized
Doxygen
FuncToTest
Init
LWT
MISRA
MQTT
MQTT's
MQTTAgentCommandFunc
MQTTAgentCommandFuncReturns
MQTTAgentConnectArgs
MQTTAgentSubscribeArgs
MQTTGetCurrentTimeFunc
MQTTQoS
MQTTRecvFailed
Misra
Mqtt
NONDET
NUM
Nondet
POSIX
PUBACK
PUBLISHes
QOS
QoS
Qos
RECV
SDK
STDC
SUBACK
SUBACK's
SYSCLK
SYSCLOCK
SYSClk
Struct
SysClk
SysClock
Sysclk
Sysclock
TODO
UNACKED
UNPADDED
UNSUB
UNSUBACK
Unpadded
Unprotect
Unprotected
Unsub
VECT
Vect
Wunused
ack
acked
acknowledgement
acknowledgements
acks
args
bool
br
bytesToRecv
cbmc
cbor
cmdCompleteCallback
cmdCompleteCb
cmock
connectArgs
connectCmdCallback
connectionArgs
const
coremqtt
coverity
ctest
ctestACK
decihours
deserialized
disconnectCmdCallback
doxygen
dup
endcond
enqueue
enqueued
enqueueing
enqueues
enum
enums
func
getpacketid
hu
ifndef
init
initalized
initializers
isystem
lcov
lwt
memset
messagectx
messagerecv
misra
mqtt
mypy
networkRecv
nondet
numSubscriptions
pAckInfo
pArgs
pCmdCallbackContext
pCmdCompleteCallbackContext
pCmdContext
pConnectArgs
pDeserializedInfo
pFuncName
pMqttInfoParam
pMsgCtx
pMsgInterface
pParams
pPendingAcks
pPublishArg
pSubackCodes
pSubscribeArgs
pSubscriptionArgs
pUnusedArg
pVoidConnectArgs
pVoidSubscribeArgs
params
pendingAcks
preprocessor
printf
publishCmdCompleteCb
pylint
pytest
pyyaml
qos
recv
sinclude
strlen
struct
structs
suback
subscribeArgs
subscribeCmdCompleteCb
sysclk
sysclock
th
uint
unpadded
unprotect
unsubscribeArgs
unsubscribeCmdCompleteCb
unsubscriptions
utest
vect
writev
xlarge
127 changes: 105 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: CI Checks

env:
bashPass: \033[32;1mPASSED -
bashInfo: \033[33;1mINFO -
bashFail: \033[31;1mFAILED -
bashEnd: \033[0m

on:
push:
branches: ["**"]
Expand All @@ -12,78 +18,112 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build

- name: Perform Recursive Clone
shell: bash
run: git submodule update --checkout --init --recursive

- env:
stepName: Build CoreMQTT
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
sudo apt-get install -y lcov
cmake -S test -B build/ \
-G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_CLONE_SUBMODULES=ON \
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG'
make -C build/ all
- name: Test
run: |
cd build/
ctest -E system --output-on-failure
cd ..
- name: Run Coverage
echo "::endgroup::"
echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}"
- name: Run Tests
run: ctest --test-dir build -E system --output-on-failure

- env:
stepName: Line and Branch Coverage Build
run: |
# ${{ env.stepName }}
echo -e "::group::${{ env.bashInfo }} Build Coverage Target ${{ env.bashEnd }}"
# Build the coverage target
make -C build/ coverage
declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*dependency\*")
echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info
echo -e "::group::${{ env.bashInfo }} Generate Coverage Report ${{ env.bashEnd }}"
# Generate coverage report, excluding extra directories
lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info '*test*' '*CMakeCCompilerId*' '*mocks*' '*dependency*'
echo "::endgroup::"
lcov --rc lcov_branch_coverage=1 --list build/coverage.info
echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}"
- name: Check Coverage
uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
with:
path: ./build/coverage.info
coverage-file: ./build/coverage.info

complexity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check complexity
uses: FreeRTOS/CI-CD-Github-Actions/complexity@main
with:
path: ./
horrid_threshold: 12

doxygen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download MQTT tag
- uses: actions/checkout@v3

- env:
stepName: Download MQTT tag
name: ${{ env.stepName }}
run: |
# We don't need to generate the coreMQTT docs, we only need the tag file. We can just download it.
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
mkdir -p source/dependency/coreMQTT/docs/doxygen/output
wget -O source/dependency/coreMQTT/docs/doxygen/output/mqtt.tag \
"https://freertos.org/Documentation/api-ref/coreMQTT/docs/doxygen/output/mqtt.tag"
echo -e "::endgroup::"
echo -e "${{env.bashPass}} ${{ env.stepName }} ${{ env.bashEnd }}"
- name: Run doxygen build
uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main
with:
path: ./

spell-check:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Run spellings check
uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
with:
path: ./

formatting:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check formatting
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
with:
path: ./

git-secrets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Checkout awslabs/git-secrets
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: awslabs/git-secrets
ref: master
Expand All @@ -94,23 +134,66 @@ jobs:
run: |
git-secrets --register-aws
git-secrets --scan
memory_statistics:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Install Python3
uses: actions/setup-python@v3
with:
submodules: 'recursive'
python-version: '3.11.0'

- name: Measure sizes
uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main
with:
config: .github/memory_statistics_config.json
check_against: docs/doxygen/include/size_table.md


link-verifier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check Links
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main
with:
path: ./


verify-manifest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0

# At time of writing the gitmodules are set not to pull
# Even when using fetch submodules. Need to run this command
# To force it to grab them.
- name: Perform Recursive Clone
shell: bash
run: git submodule update --checkout --init --recursive

- name: Run manifest verifier
uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@CI-CD-Overhaul
with:
path: ./
fail-on-incorrect-version: true

proof_ci:
runs-on: cbmc_ubuntu-latest_64-core
runs-on: ubuntu-latest
steps:
- name: Set up CBMC runner
uses: FreeRTOS/CI-CD-Github-Actions/set_up_cbmc_runner@main
- name: Run CBMC
uses: FreeRTOS/CI-CD-Github-Actions/run_cbmc@main
with:
proofs_dir: test/cbmc/proofs

Loading

0 comments on commit 508651c

Please sign in to comment.