Skip to content

Commit

Permalink
CI-CD Updates (#36)
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 8ce2b28 commit bf83deb
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 131 deletions.
22 changes: 22 additions & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
CBMC
CBOR
CMOCK
CMock
Cmock
Coverity
DDisable
DNDEBUG
DUNITY
MISRA
MQTT
Misra
Wunused
cbmc
cbor
cmock
coverity
ctest
lcov
misra
sinclude
utest
51 changes: 37 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Build
run: |
sudo apt-get install -y lcov
Expand All @@ -34,12 +34,12 @@ jobs:
- name: Check Coverage
uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
with:
path: ./build/coverage.info
coverage-file: ./build/coverage.info
build-with-default-config:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Build
run: |
cmake -S test -B build/ \
Expand All @@ -50,15 +50,15 @@ jobs:
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: ./
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 @@ -67,25 +67,25 @@ jobs:
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 @@ -99,11 +99,34 @@ jobs:
memory_statistics:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: 'recursive'
submodules: "recursive"
- 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

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

- name: Run manifest verifier
uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@main
with:
path: ./
fail-on-incorrect-version: true
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: Fleet-Provisioning-for-AWS-IoT-embedded-sdk
Expand Down
65 changes: 37 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
# AWS IoT Fleet Provisioning Library

**[API Documentation Pages for current and previous releases of this library can be found here](https://aws.github.io/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/)**

The Fleet Provisioning library enables you to provision IoT devices without
device certificates using the [Fleet Provisioning feature of AWS IoT Core][a1].
For an overview of provisioning options available, see [Device
provisioning][a2]. This library has no dependencies on any additional libraries
other than the standard C library, and therefore, can be used with any MQTT
library. This library is distributed under the [MIT Open Source License][a3].

[a1]: https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html
[a1]:
https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html
[a2]: https://docs.aws.amazon.com/iot/latest/developerguide/iot-provision.html
[a3]: LICENSE

This library has gone through code quality checks including verification that
no function has a [GNU Complexity][a4] score over 8, and checks against
deviations from mandatory rules in the [MISRA coding standard][a5]. Deviations
from the MISRA C:2012 guidelines are documented under [MISRA Deviations][a6].
This library has also undergone static code analysis using [Coverity static
This library has gone through code quality checks including verification that no
function has a [GNU Complexity][a4] score over 8, and checks against deviations
from mandatory rules in the [MISRA coding standard][a5]. Deviations from the
MISRA C:2012 guidelines are documented under [MISRA Deviations][a6]. This
library has also undergone static code analysis using [Coverity static
analysis][a7], and validation of memory safety through the [CBMC automated
reasoning tool][a8].

Expand All @@ -29,33 +32,35 @@ See memory requirements for this library [here][a9].

[a9]: ./docs/doxygen/include/size_table.md

**AWS IoT Fleet Provisioning Library v1.1.0 [source code](https://github.com/aws/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/tree/v1.1.0/source) is part of the [FreeRTOS 202210.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202210.00-LTS) release.**

**AWS IoT Fleet Provisioning Library v1.1.0
[source code](https://github.com/aws/Fleet-Provisioning-for-AWS-IoT-embedded-sdk/tree/v1.1.0/source)
is part of the
[FreeRTOS 202210.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202210.00-LTS)
release.**

## AWS IoT Fleet Provisioning Library Config File

The AWS IoT Fleet Provisioning Library exposes build configuration
macros that are required for building the library. A list of all the
configurations and their default values are defined in
[fleet\_provisioning\_config\_defaults.h][b1]. To provide custom values for the
configuration macros, a config file named `fleet_provisioning_config.h` can be
provided by the application to the library.
The AWS IoT Fleet Provisioning Library exposes build configuration macros that
are required for building the library. A list of all the configurations and
their default values are defined in [fleet_provisioning_config_defaults.h][b1].
To provide custom values for the configuration macros, a config file named
`fleet_provisioning_config.h` can be provided by the application to the library.

[b1]: source/include/fleet_provisioning_config_defaults.h

By default, a `fleet_provisioning_config.h` config file is required to build
the library. To disable this requirement and build the library with default
configuration values, provide `FLEET_PROVISIONING_DO_NOT_USE_CUSTOM_CONFIG` as
a compile time preprocessor macro.
By default, a `fleet_provisioning_config.h` config file is required to build the
library. To disable this requirement and build the library with default
configuration values, provide `FLEET_PROVISIONING_DO_NOT_USE_CUSTOM_CONFIG` as a
compile time preprocessor macro.

**Thus, the Fleet Provisioning library can be built by either**:

* Defining a `fleet_provisioning_config.h` file in the application, and adding
- Defining a `fleet_provisioning_config.h` file in the application, and adding
it to the include directories list of the library.

**OR**

* Defining the `FLEET_PROVISIONING_DO_NOT_USE_CUSTOM_CONFIG` preprocessor macro
- Defining the `FLEET_PROVISIONING_DO_NOT_USE_CUSTOM_CONFIG` preprocessor macro
for the library build.

## Building the Library
Expand All @@ -81,16 +86,16 @@ library target in [test/CMakeLists.txt][c2] file.
### Platform Prerequisites

- For running unit tests:
- **C90 compiler** like gcc.
- **CMake 3.13.0 or later**.
- **C90 compiler** like gcc.
- **CMake 3.13.0 or later**.
- For running the coverage target, **gcov** and **lcov** are additionally
required.

### Steps to build **Unit Tests**

1. Go to the root directory of this repository.

1. Run the *cmake* command:
1. Run the _cmake_ command:
`cmake -S test -B build -DBUILD_CLONE_SUBMODULES=ON`.

1. Run this command to build the library and unit tests: `make -C build all`.
Expand All @@ -101,24 +106,28 @@ library target in [test/CMakeLists.txt][c2] file.

## CBMC

To learn more about CBMC and proofs specifically, review the training material [here](https://model-checking.github.io/cbmc-training).
To learn more about CBMC and proofs specifically, review the training material
[here](https://model-checking.github.io/cbmc-training).

The `test/cbmc/proofs` directory contains CBMC proofs.

In order to run these proofs you will need to install CBMC and other tools by following the instructions [here](https://model-checking.github.io/cbmc-training/installation.html).
In order to run these proofs you will need to install CBMC and other tools by
following the instructions
[here](https://model-checking.github.io/cbmc-training/installation.html).

## Reference examples

The [AWS IoT Embedded C-SDK repository][e1] contains a demo showing the use of
the AWS IoT Fleet Provisioning Library on a POSIX platform [here][e2].

[e1]: https://github.com/aws/aws-iot-device-sdk-embedded-C
[e2]: https://github.com/aws/aws-iot-device-sdk-embedded-C/tree/main/demos/fleet_provisioning/fleet_provisioning_with_csr
[e2]:
https://github.com/aws/aws-iot-device-sdk-embedded-C/tree/main/demos/fleet_provisioning/fleet_provisioning_with_csr

## Generating documentation

The Doxygen references were created using Doxygen version 1.9.2. To generate
the Doxygen pages, please run the following command from the root of this
The Doxygen references were created using Doxygen version 1.9.2. To generate the
Doxygen pages, please run the following command from the root of this
repository:

```sh
Expand Down
31 changes: 31 additions & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
version: '0.2'
# Allows things like stringLength
allowCompoundWords: true

# Read files not to spell check from the git ignore
useGitignore: true

# Language settings for C
languageSettings:
- caseSensitive: false
enabled: true
languageId: c
locale: "*"

# Add a dictionary, and the path to the word list
dictionaryDefinitions:
- name: freertos-words
path: '.github/.cSpellWords.txt'
addWords: true

dictionaries:
- freertos-words

# Paths and files to ignore
ignorePaths:
- 'dependency'
- 'docs'
- 'ThirdParty'
- 'History.txt'
Loading

0 comments on commit bf83deb

Please sign in to comment.