Skip to content

Commit 03290fe

Browse files
authored
CI-CD Updates (#260)
* Use new version of CI-CD Actions, checkout@v3 instead of checkout@v2 on all jobs * Use cSpell spell check, and use ubuntu-20.04 for formatting check * Add in bot formatting action
1 parent 9bfc624 commit 03290fe

File tree

8 files changed

+310
-522
lines changed

8 files changed

+310
-522
lines changed

.github/.cSpellWords.txt

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
CBMC
2+
CBOR
3+
CMOCK
4+
CMock
5+
CSDK
6+
Cmock
7+
Coverity
8+
DCMOCK
9+
DNDEBUG
10+
DUNITY
11+
MISRA
12+
MQTT
13+
Misra
14+
UNACKED
15+
UNSUB
16+
UNSUBACK
17+
Wunused
18+
cbmc
19+
cbor
20+
cmock
21+
coremqtt
22+
coverity
23+
ctest
24+
getpacketid
25+
isystem
26+
lcov
27+
misra
28+
mypy
29+
pylint
30+
pytest
31+
pyyaml
32+
sinclude
33+
unsubscriptions
34+
utest

.github/workflows/ci.yml

+90-23
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
name: CI Checks
1+
name: "CI Checks"
2+
3+
env:
4+
bashPass: \033[32;1mPASSED -
5+
bashInfo: \033[33;1mINFO -
6+
bashFail: \033[31;1mFAILED -
7+
bashEnd: \033[0m
28

39
on:
410
push:
@@ -12,71 +18,93 @@ jobs:
1218
runs-on: ubuntu-latest
1319
steps:
1420
- name: Clone This Repo
15-
uses: actions/checkout@v2
16-
- name: Build
21+
uses: actions/checkout@v3
22+
23+
- env:
24+
stepName: Build CoreMQTT
1725
run: |
26+
# ${{ env.stepName }}
27+
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
28+
1829
sudo apt-get install -y lcov
1930
cmake -S test -B build/ \
2031
-G "Unix Makefiles" \
2132
-DCMAKE_BUILD_TYPE=Debug \
2233
-DBUILD_CLONE_SUBMODULES=ON \
2334
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -Werror -DNDEBUG -DLIBRARY_LOG_LEVEL=LOG_DEBUG'
2435
make -C build/ all
25-
- name: Test
26-
run: |
27-
cd build/
28-
ctest -E system --output-on-failure
29-
cd ..
30-
- name: Run Coverage
36+
echo "::endgroup::"
37+
38+
echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}"
39+
40+
- name: Run System Tests
41+
run: ctest --test-dir build -E system --output-on-failure
42+
43+
- env:
44+
stepName: Line and Branch Coverage Build
3145
run: |
46+
# ${{ env.stepName }}
47+
echo -e "::group::${{ env.bashInfo }} Build Coverage Target ${{ env.bashEnd }}"
48+
# Build the coverage target
3249
make -C build/ coverage
33-
declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*")
34-
echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info
50+
51+
echo -e "::group::${{ env.bashInfo }} Generate Coverage Report ${{ env.bashEnd }}"
52+
# Generate coverage report, excluding extra directories
53+
lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info '*test*' '*CMakeCCompilerId*' '*mocks*'
54+
55+
echo "::endgroup::"
3556
lcov --rc lcov_branch_coverage=1 --list build/coverage.info
57+
echo -e "${{ env.bashPass }} ${{env.stepName}} ${{ env.bashEnd }}"
58+
3659
- name: Check Coverage
3760
uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
3861
with:
39-
path: ./build/coverage.info
62+
coverage-file: ./build/coverage.info
63+
4064
complexity:
4165
runs-on: ubuntu-latest
4266
steps:
43-
- uses: actions/checkout@v2
67+
- uses: actions/checkout@v3
4468
- name: Check complexity
4569
uses: FreeRTOS/CI-CD-Github-Actions/complexity@main
4670
with:
4771
path: ./
48-
horrid_threshold: 10
72+
horrid_threshold: 12
73+
4974
doxygen:
5075
runs-on: ubuntu-latest
5176
steps:
52-
- uses: actions/checkout@v2
77+
- uses: actions/checkout@v3
5378
- name: Run doxygen build
5479
uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main
5580
with:
5681
path: ./
82+
5783
spell-check:
5884
runs-on: ubuntu-latest
5985
steps:
6086
- name: Clone This Repo
61-
uses: actions/checkout@v2
87+
uses: actions/checkout@v3
6288
- name: Run spellings check
6389
uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
6490
with:
6591
path: ./
92+
6693
formatting:
6794
runs-on: ubuntu-20.04
6895
steps:
69-
- uses: actions/checkout@v2
96+
- uses: actions/checkout@v3
7097
- name: Check formatting
7198
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
7299
with:
73100
path: ./
101+
74102
git-secrets:
75103
runs-on: ubuntu-latest
76104
steps:
77-
- uses: actions/checkout@v2
105+
- uses: actions/checkout@v3
78106
- name: Checkout awslabs/git-secrets
79-
uses: actions/checkout@v2
107+
uses: actions/checkout@v3
80108
with:
81109
repository: awslabs/git-secrets
82110
ref: master
@@ -87,37 +115,76 @@ jobs:
87115
run: |
88116
git-secrets --register-aws
89117
git-secrets --scan
118+
90119
custom-standard-c-headers:
91120
runs-on: ubuntu-latest
92121
steps:
93122
- name: Clone This Repo
94-
uses: actions/checkout@v2
95-
- name: Build
123+
uses: actions/checkout@v3
124+
- env:
125+
stepName: Build With Custom Headers
96126
run: |
127+
# ${{ env.stepName }}
128+
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
129+
130+
# Copy the custom headers into the build directory
97131
mkdir -p override-include
98132
cp source/include/stdbool.readme override-include/stdbool.h
99133
cp source/include/stdint.readme override-include/stdint.h
134+
135+
# Build using the custom headers
100136
cmake -S test -B build/ \
101137
-G "Unix Makefiles" \
102138
-DBUILD_CLONE_SUBMODULES=ON \
103139
-DCMAKE_C_FLAGS='-Wall -Wextra -I../override-include'
104140
make -C build/ coverity_analysis
141+
echo "::endgroup::"
142+
143+
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
144+
105145
memory_statistics:
106146
runs-on: ubuntu-latest
107147
steps:
108-
- uses: actions/checkout@v2
148+
- uses: actions/checkout@v3
109149
with:
110150
submodules: 'recursive'
111151
- name: Install Python3
112-
uses: actions/setup-python@v2
152+
uses: actions/setup-python@v3
113153
with:
114154
python-version: '3.11.0'
115155
- name: Measure sizes
116156
uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main
117157
with:
118158
config: .github/memory_statistics_config.json
119159
check_against: docs/doxygen/include/size_table.md
160+
161+
link-verifier:
162+
runs-on: ubuntu-latest
163+
steps:
164+
- uses: actions/checkout@v3
165+
- name: Check Links
166+
env:
167+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168+
uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main
169+
with:
170+
path: ./
171+
172+
verify-manifest:
173+
runs-on: ubuntu-latest
174+
steps:
175+
- uses: actions/checkout@v3
176+
with:
177+
submodules: true
178+
fetch-depth: 0
179+
180+
- name: Run manifest verifier
181+
uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@main
182+
with:
183+
path: ./
184+
fail-on-incorrect-version: true
185+
120186
proof_ci:
187+
if: ${{ github.event.pull_request }}
121188
runs-on: cbmc_ubuntu-latest_64-core
122189
steps:
123190
- name: Set up CBMC runner

.github/workflows/formatting.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Format Pull Request Files
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
env:
8+
bashPass: \033[32;1mPASSED -
9+
bashInfo: \033[33;1mINFO -
10+
bashFail: \033[31;1mFAILED -
11+
bashEnd: \033[0m
12+
13+
jobs:
14+
Formatting:
15+
name: Run Formatting Check
16+
if: ${{ github.event.issue.pull_request }} &&
17+
( ( github.event.comment.body == '/bot run uncrustify' ) ||
18+
( github.event.comment.body == '/bot run formatting' ) )
19+
runs-on: ubuntu-20.04
20+
steps:
21+
- name: Apply Formatting Fix
22+
uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main
23+
id: check-formatting

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2323
steps:
2424
- name: Checkout code
25-
uses: actions/checkout@v2
25+
uses: actions/checkout@v3
2626
- name: Check if tag exists
2727
run: |
2828
git fetch origin
@@ -49,7 +49,7 @@ jobs:
4949
runs-on: ubuntu-latest
5050
steps:
5151
- name: Checkout code
52-
uses: actions/checkout@v2
52+
uses: actions/checkout@v3
5353
with:
5454
ref: ${{ github.event.inputs.commit_id }}
5555
- name: Configure git identity
@@ -87,7 +87,7 @@ jobs:
8787
- name: Install ZIP tools
8888
run: sudo apt-get install zip unzip
8989
- name: Checkout code
90-
uses: actions/checkout@v2
90+
uses: actions/checkout@v3
9191
with:
9292
ref: ${{ github.event.inputs.commit_id }}
9393
path: coreMQTT

0 commit comments

Comments
 (0)