Skip to content

Commit

Permalink
CI-CD Updates (#496)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Skptak authored Sep 5, 2023
1 parent 243786d commit f1bcddb
Show file tree
Hide file tree
Showing 147 changed files with 528 additions and 1,381 deletions.
46 changes: 46 additions & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
CBMC
CBOR
CMOCK
CMock
Cmock
Coverity
DCMOCK
DNDEBUG
DUNITY
FOOB
FOOBA
FOOBDA
MISRA
MQTT
Misra
OPTIMISED
Wunused
cbmc
cbor
cborvalue
cmock
coverity
ctest
deinitializing
isystem
lcov
lpthread
misra
mqdes
mqttstatus
mqueue
osstatus
otahttppage
otahttpsectionoverview
otamqttpage
otamqttsectionoverview
otaosfipage
otaosfisectionoverview
otapalpage
otapalsectionoverview
pbuffer
pclienttoken
sinclude
stringz
tinycbor
utest
2 changes: 2 additions & 0 deletions .github/.exclude-urls.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://dummy-url.com/ota.bin

90 changes: 57 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Check warnings
run: |
git submodule update --init --recursive --checkout --depth 1
Expand All @@ -26,20 +26,20 @@ jobs:
complexity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Setup
run: sudo apt-get install complexity
- name: Complexity
uses: FreeRTOS/CI-CD-Github-Actions/complexity@main
with:
path: ./
horrid_threshold: 10
horrid_threshold: 14

unittest:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Build
run: |
git submodule update --init --recursive --checkout --depth 1
Expand All @@ -55,28 +55,31 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Generate Build Files
run: |
git submodule update --init --recursive --checkout --depth 1
sudo apt-get install -y lcov
cmake -S test -B build \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra -DNDEBUG'
- name: Run Coverage
run: |
cmake --build build/ --target coverage
- name: Check Coverage
uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
with:
path: ./build/coverage.info
coverage-file: ./build/coverage.info
line-coverage-min: 100
branch-coverage-min: 100

doxygen:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Run doxygen build
uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main
with:
Expand All @@ -85,31 +88,17 @@ jobs:
spell-check:
runs-on: ubuntu-latest
steps:
- name: Checkout Parent Repo
uses: actions/checkout@v2
with:
ref: main
repository: aws/aws-iot-device-sdk-embedded-C
- 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: tmp
- name: Install spell
run: |
sudo apt-get install spell
sudo apt-get install util-linux
- name: Check spelling
run: |
PATH=$PATH:$PWD/tools/spell
find-unknown-comment-words --directory tmp/ --lexicon tmp/tools/lexicon.txt
if [ $? -ne "0" ]; then
exit 1
fi
path: ./

formatting:
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:
Expand All @@ -119,11 +108,11 @@ jobs:
git-secrets:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Checkout awslabs/git-secrets
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: awslabs/git-secrets
ref: master
Expand All @@ -138,19 +127,54 @@ jobs:
memory_statistics:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Clone submodules
run: git submodule update --init --recursive --checkout --depth 1
- name: Install Python3
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: '3.11.0'
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
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: ./
allowlist-file: .github/.exclude-urls.txt

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@main
with:
path: ./
fail-on-incorrect-version: true

proof_ci:
if: ${{ github.event.pull_request }}
runs-on: cbmc_ubuntu-latest_16-core
steps:
- name: Set up CBMC runner
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Format Pull Request Files

on:
issue_comment:
types: [created]

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

jobs:
Formatting:
name: Run Formatting Check
if: ${{ github.event.issue.pull_request }} &&
( ( github.event.comment.body == '/bot run uncrustify' ) ||
( github.event.comment.body == '/bot run formatting' ) )
runs-on: ubuntu-20.04
steps:
- name: Apply Formatting Fix
uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main
id: check-formatting
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.commit_id }}
- name: Configure git identity
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Install ZIP tools
run: sudo apt-get install zip unzip
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.commit_id }}
path: ota-for-aws-iot-embedded-sdk
Expand Down
4 changes: 2 additions & 2 deletions MISRA.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ _Ref 8.13.1_
- MISRA C-2012 Rule 8.13 There are multiple functions that all use the same function header so that
they can be assigned to function pointers in a seamless manner. There are a few that modify the
OtaAgentContext_t that gets passed in. In order to allow convienent assignment of these function pointers
we supress this rule on this function that can't have const added.
we suppress this rule on this function that can't have const added.

#### Rule 10.1
_Ref 10.1.1_
Expand All @@ -44,7 +44,7 @@ _Ref 10.8.1_
_Ref 11.8.1_

- Misra C-2012 Rule 11.8 will raise an error if certain variables are not marked as const, even if the variables do get
modified in that function. As such there are two occurences where to get around that error, we supress these.
modified in that function. As such there are two occurrences where to get around that error, we suppress these.

#### Rule 19.2
_Ref 19.2.1_
Expand Down
Loading

0 comments on commit f1bcddb

Please sign in to comment.