Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI-CD-Onboarding #39

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/.cSpellWords.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
acceptmbox
BBOOL
cbmc
CBMC
cbor
CBOR
cmock
Cmock
CMock
CMOCK
CMSIS
coremqtt
coverity
Coverity
CSDK
ctest
DCMOCK
decihours
Decihours
DECIHOURS
DNDEBUG
DUNITY
ecdhctx
ECKEY
EKVB
EVKB
evkbmimxrt
evkmimxrt
fromisr
getpacketid
IPSR
isystem
JITP
Jitr
JITR
KITP
kvstore
Kvstore
KVStore
KVSTORE
lcov
LWIPOPTS
mbed
mcuboot
MCUX
MCUXpresso
MEMP
mflash
Mflash
MFlash
MFLASH
MIMXRT
misra
Misra
MISRA
mosquitto
MQTT
mqttexample
mypy
netif
NETIF
NOASSERT
nondet
Nondet
NONDET
noout
NVIC
Oliveri
otaexample
pbufs
PBUFS
pval
pylint
pytest
pyyaml
RECVMBOX
sinclude
Stefano
submoduled
sysclk
Sysclk
SysClk
SYSClk
SYSCLK
sysclock
Sysclock
SysClock
SYSCLOCK
Tera
Teraterm
TLSC
UNACKED
unpadded
Unpadded
UNPADDED
unprotect
Unprotect
Unprotected
UNSUB
UNSUBACK
unsubscriptions
utest
vect
Vect
VECT
Wunused
63 changes: 63 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Contributing Guidelines

Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
documentation, we greatly value feedback and contributions from our community.

Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
information to effectively respond to your bug report or contribution.


## Reporting Bugs/Feature Requests

We welcome you to use the GitHub issue tracker to report bugs or suggest features.

When filing an issue, please check [existing open](https://github.com/FreeRTOS/coreMQTT/issues), or [recently closed](https://github.com/FreeRTOS/coreMQTT/issues?q=is%3Aissue+is%3Aclosed), issues to make sure somebody else hasn't already
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:

* A reproducible test case or series of steps
* The version of our code being used
* Any modifications you've made relevant to the bug
* Anything unusual about your environment or deployment


## Contributing via Pull Requests
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

1. You are working against the latest source on the *main* branch.
1. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
1. You open an issue to discuss any significant work - we would hate for your time to be wasted.

To send us a pull request, please:

1. Fork the repository.
1. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
1. Ensure that your contributions conform to the [style guide](https://www.freertos.org/FreeRTOS-Coding-Standard-and-Style-Guide.html).
1. Format your code with uncrustify, using the config available in [FreeRTOS/CI-CD-Github-Actions](https://github.com/FreeRTOS/CI-CD-Github-Actions/blob/main/formatting/uncrustify.cfg).
1. Ensure local tests pass.
1. Commit to your fork using clear commit messages.
1. Send us a pull request, answering any default questions in the pull request interface.
1. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).


## Finding contributions to work on
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/FreeRTOS/coreMQTT/labels?q=help+wanted) issues is a great place to start.


## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
[email protected] with any additional questions or comments.


## Security issue notifications
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.


## Licensing

See the [LICENSE](../LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

We may ask you to sign a [Contributor License Agreement (CLA)](https://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
89 changes: 29 additions & 60 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,80 +7,49 @@ on:
branches: ["**"]

jobs:
spell-check:
runs-on: ubuntu-latest
formatting:
runs-on: ubuntu-20.04
steps:
- name: Checkout Parent Repo
uses: actions/checkout@v2
with:
ref: main
repository: FreeRTOS/CI-CD-Github-Actions
path: actions
- name: Clone This Repo
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: ./NXPRef
- name: Install spell
run: |
sudo apt-get install spell
sudo apt-get install util-linux
- name: Check spelling
run: |
PATH=$PATH:actions/spellings/tools
# Make sure that the portable directory is not included in the spellcheck.
sed -i "s/-iname \\\\\*.\[ch\] -o/-not -path \\\*Middleware\\\\\/NXP\\\* -iname \\\\\*.\[ch\] -o/g" actions/spellings/tools/find-unknown-comment-words
find-unknown-comment-words --directory NXPRef/ --lexicon NXPRef/lexicon.txt
if [ "$?" = "0" ]; then
exit 0
else
exit 1
fi
- uses: actions/checkout@v3
- name: Check Formatting of Files
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main

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

link-verifier:
runs-on: ubuntu-latest
steps:
- name: Clone This Repo
uses: actions/checkout@v2
- name: Run link verifier
uses: actions/checkout@v3
- name: Link Verification
uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main
with:
path: ./
include-file-types: .c,.h,.md,.dox
exclude-dirs: NXP

formatting:
verify-manifest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Uncrustify
run: sudo apt-get install uncrustify
- name: Run Uncrustify
run: |
uncrustify --version
find -not -path ".*/Middleware/NXP*" -iname "*.[hc]" -exec uncrustify --check -c ./uncrustify.cfg {} +
if [ "$?" = "0" ]; then
exit 0
else
echo -e "\033[31;1;43mFormatting check (using Uncrustify) failed...\033[0m"
exit 1
fi
- name: Check For Trailing Whitespace
run: |
set +e
grep --exclude-dir="NXP" --exclude="README.md" -rnI -e "[[:blank:]]$" .
if [ "$?" = "0" ]; then
echo "Files have trailing whitespace."
exit 1
else
exit 0
fi
- 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

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 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
14 changes: 7 additions & 7 deletions GSG.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ in MAC or Linux machines.

### 3.3 Preparing an Executable Image Sent to the Device via OTA

For a succesful OTA, follow the below steps to prepare the executable image:
For a successful OTA, follow the below steps to prepare the executable image:
1. The version number of the image sent via OTA must be higher than that already running on the device, so temporarily update the executable image's version number.\
2. Build the executable image.\
3. Sign the executable image with the key used by the bootloader to validate the image.\
Expand Down Expand Up @@ -468,19 +468,19 @@ perform OTA updates.
1. Create an ECDSA code-signing private key.
```
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -pkeyopt \
ec_param_enc:named_curve -outform PEM -out ecdsasigner.key
ec_param_enc:named_curve -outform PEM -out ecdsa_signer.key
```

1. Create an ECDSA code-signing certificate.
```
openssl req -new -x509 -config cert_config.txt -extensions my_exts -nodes \
-days 365 -key ecdsasigner.key -out ecdsasigner.crt
-days 365 -key ecdsa_signer.key -out ecdsa_signer.crt
```

1. Import the code-signing certificate, private key, and certificate chain into the AWS
Certificate Manager.
```
aws acm import-certificate --certificate fileb://ecdsasigner.crt --private-key fileb://ecdsasigner.key
aws acm import-certificate --certificate file://ecdsa_signer.crt --private-key file://ecdsa_signer.key
```

1. Confirm the ARN for your certificate. You need this ARN when you create an OTA update job.
Expand All @@ -490,13 +490,13 @@ perform OTA updates.

1. Get the ECDSA public key from the code signing credentials generated in 6.2:
```
openssl ec -in ecdsasigner.key -pubout -outform PEM -out ecdsasigner-pub-key.pem
openssl ec -in ecdsa_signer.key -pubout -outform PEM -out ecdsa_signer-pub-key.pem
```

1. Confirm that the file `esdsaigner-pub-key.pem` has been created correctly.
1. Confirm that the file `ecdsa_signer-pub-key.pem` has been created correctly.
![Image](https://user-images.githubusercontent.com/45887168/161103614-dd30b4a0-de7c-49d3-8567-a5054a446080.png)

1. Open the target MCUExpressoIDE aws_iot_pubsub project. To switch to device provisioning mode
1. Open the target MCUXpressoIDE aws_iot_pubsub project. To switch to device provisioning mode
set `appmainPROVISIONING_MODE` to `1`, recompile and download the firmware to the board.

1. On the terminal CLI, run the following command:
Expand Down
4 changes: 2 additions & 2 deletions Middleware/FreeRTOS/lwip_osal/include/lwipopts_freertos.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
* per active UDP "connection". */
#define MEMP_NUM_UDP_PCB 8

/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP
/* MEMP_NUM_TCP_PCB: the number of simultaneously active TCP
* connections. */
#define MEMP_NUM_TCP_PCB 32

Expand All @@ -114,7 +114,7 @@
* segments. */
#define MEMP_NUM_TCP_SEG 255

/* MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing
/* MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing
* packets (pbufs) that are waiting for an ARP request (to resolve
* their destination address) to finish. (requires the ARP_QUEUEING option) */
#define MEMP_NUM_ARP_QUEUE 8
Expand Down
6 changes: 3 additions & 3 deletions Middleware/NXP/hostLib/a71ch/ex/ex_ecc_nohc.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static U8 exEccNoHostCrypto(U8 initMode) {
eccPrivKeyTlsNist256_1, (U16)sizeof(eccPrivKeyTlsNist256_1));
result &= AX_CHECK_SW(err, SW_OK, "err");

// Check whether public key (of keypair) was written succesfully.
// Check whether public key (of keypair) was written successfully.
pubEccKeyScratchLen = sizeof(pubEccKeyScratch);
expectedPubKeyLen = 65;
keyIdx = A71CH_KEY_PAIR_0;
Expand Down Expand Up @@ -235,7 +235,7 @@ static U8 exEccNoHostCrypto(U8 initMode) {
err = A71_SetEccPublicKey(keyIdx, eccPubKeyCANist256_1, (U16)sizeof(eccPubKeyCANist256_1));
result &= AX_CHECK_SW(err, SW_OK, "err");

// Check whether public key at index 1 was written succesfully.
// Check whether public key at index 1 was written successfully.
pubEccKeyScratchLen = sizeof(pubEccKeyScratch);
expectedPubKeyLen = 65;
keyIdx = A71CH_PUBLIC_KEY_1;
Expand All @@ -246,7 +246,7 @@ static U8 exEccNoHostCrypto(U8 initMode) {
result &= AX_COMPARE_BYTE_ARRAY("pubEccKeyScratch", pubEccKeyScratch, pubEccKeyScratchLen,
"eccPubKeyCANist256_1", eccPubKeyCANist256_1, sizeof(eccPubKeyCANist256_1), AX_COLON_32);

// Check whether public key at index 0 was written succesfully.
// Check whether public key at index 0 was written successfully.
pubEccKeyScratchLen = sizeof(pubEccKeyScratch);
expectedPubKeyLen = 65;
keyIdx = A71CH_PUBLIC_KEY_0;
Expand Down
Loading
Loading