Skip to content

Commit 76f7059

Browse files
authored
Add CI-CD checks, update readmes (#52)
Add the common [FreeRTOS/CI-CD Checks](https://github.com/FreeRTOS/CI-CD-Github-Actions) to this repo Formatting fixes of various files Add in doing the default `idf.py` build on CI-CD Checks
1 parent 533039e commit 76f7059

34 files changed

+3564
-2640
lines changed

.github/.cSpellWords.txt

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
BTDM
2+
CBMC
3+
CBOR
4+
CMOCK
5+
CMock
6+
CSDK
7+
Cmock
8+
Coverity
9+
DCMOCK
10+
DNDEBUG
11+
DTIM
12+
DTM
13+
DUNITY
14+
EFFF
15+
EFUSE
16+
Espressif
17+
IRAM
18+
LOGD
19+
LOGI
20+
LOGW
21+
MISRA
22+
MQTT
23+
Misra
24+
NETIF
25+
Nayuki
26+
OTAE
27+
QRCODE
28+
QRCODEGEN
29+
SPIWP
30+
UNACKED
31+
UNSUB
32+
UNSUBACK
33+
Wunused
34+
Yscwc
35+
aflags
36+
bssid
37+
cbmc
38+
cbor
39+
cmock
40+
coremqtt
41+
coverity
42+
ctest
43+
cust
44+
espressif
45+
getpacketid
46+
gpio
47+
isystem
48+
lcov
49+
leds
50+
lmac
51+
mbox
52+
misra
53+
mockrng
54+
mqttexample
55+
mypy
56+
netif
57+
noos
58+
otademoconfig
59+
pcontext
60+
pylint
61+
pytest
62+
pyyaml
63+
qrcode
64+
qrcodegen
65+
qrsize
66+
rsdiv
67+
rssi
68+
search
69+
sinclude
70+
subpubunsubconfig
71+
tsens
72+
unsubscriptions
73+
utest

.github/CONTRIBUTING.md

+15-17
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ information to effectively respond to your bug report or contribution.
1111

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

14-
When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
14+
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
1515
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
1616

1717
* A reproducible test case or series of steps
@@ -24,28 +24,26 @@ reported the issue. Please try to include as much information as you can. Detail
2424
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
2525

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

3030
To send us a pull request, please:
3131

32-
1. Ensure you are considering a change to AWS source code (FreeRTOS kernel, AWS libraries). Proposed changes to 3rd party code should be submitted instead to the 3rd party.
33-
2. Fork the repository.
34-
3. 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.
35-
4. Ensure local tests pass.
36-
5. Commit to your fork using clear commit messages.
37-
6. Send us a pull request, answering any default questions in the pull request interface.
38-
7. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
32+
1. Fork the repository.
33+
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.
34+
1. Ensure that your contributions conform to the [style guide](https://docs.aws.amazon.com/embedded-csdk/202011.00/lib-ref/docs/doxygen/output/html/guide_developer_styleguide.html).
35+
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).
36+
1. Ensure local tests pass.
37+
1. Commit to your fork using clear commit messages.
38+
1. Send us a pull request, answering any default questions in the pull request interface.
39+
1. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
3940

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

43-
## Getting Your Pull Request Merged
44-
All Pull Requests must be approved by our review team before it can be merged in. We appreciate your patience while pull requests are reviewed as the time taken will depend on its complexity and wider implications.
45-
4644

4745
## Finding contributions to work on
48-
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' issues is a great place to start.
46+
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.
4947

5048

5149
## Code of Conduct
@@ -55,11 +53,11 @@ [email protected] with any additional questions or comments.
5553

5654

5755
## Security issue notifications
58-
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
56+
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.
5957

6058

6159
## Licensing
6260

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

65-
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
63+
We may ask you to sign a [Contributor License Agreement (CLA)](https://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.

.github/memory_statistics_config.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"lib_name": "coreMQTT",
3+
"src": [
4+
"source/core_mqtt.c",
5+
"source/core_mqtt_state.c",
6+
"source/core_mqtt_serializer.c"
7+
],
8+
"include": [
9+
"source/include",
10+
"source/interface"
11+
],
12+
"compiler_flags": [
13+
"MQTT_DO_NOT_USE_CUSTOM_CONFIG"
14+
]
15+
}

.github/workflows/ci.yml

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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
8+
9+
on:
10+
push:
11+
branches: ["**"]
12+
pull_request:
13+
branches: [main]
14+
workflow_dispatch:
15+
16+
jobs:
17+
demo-builds:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
with:
22+
submodules: true
23+
fetch-depth: 0
24+
25+
- env:
26+
bashPass: \033[32;1mPASSED -
27+
bashInfo: \033[33;1mINFO -
28+
bashFail: \033[31;1mFAILED -
29+
bashEnd: \033[0m
30+
stepName: Perform Recursive Clone of esp-aws-iot
31+
name: ${{ env.stepName }}
32+
shell: bash
33+
run: |
34+
# ${{ env.stepName }}
35+
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
36+
git submodule update --checkout --init --recursive
37+
echo -e "::endgroup::"
38+
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
39+
40+
- name: esp-idf build
41+
uses: espressif/esp-idf-ci-action@v1
42+
with:
43+
esp_idf_version: v5.0
44+
target: esp32c3
45+
path: './'
46+
47+
spell-check:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Clone This Repo
51+
uses: actions/checkout@v3
52+
- name: Run spellings check
53+
uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
54+
with:
55+
path: ./
56+
57+
formatting:
58+
runs-on: ubuntu-20.04
59+
steps:
60+
- uses: actions/checkout@v3
61+
- name: Check formatting
62+
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
63+
with:
64+
path: ./
65+
66+
link-verifier:
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v3
70+
- name: Check Links
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main
74+
with:
75+
path: ./
76+
77+
verify-manifest:
78+
runs-on: ubuntu-latest
79+
steps:
80+
- uses: actions/checkout@v3
81+
with:
82+
submodules: true
83+
fetch-depth: 0
84+
85+
- env:
86+
bashPass: \033[32;1mPASSED -
87+
bashInfo: \033[33;1mINFO -
88+
bashFail: \033[31;1mFAILED -
89+
bashEnd: \033[0m
90+
stepName: Perform Recursive Clone of esp-aws-iot
91+
name: ${{ env.stepName }}
92+
shell: bash
93+
run: |
94+
# ${{ env.stepName }}
95+
echo -e "::group::${{ env.bashInfo }} ${{ env.stepName }} ${{ env.bashEnd }}"
96+
git submodule update --checkout --init --recursive
97+
echo -e "::endgroup::"
98+
echo -e "${{ env.bashPass }} ${{ env.stepName }} ${{ env.bashEnd }}"
99+
100+
- name: Run manifest verifier
101+
uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@main
102+
with:
103+
path: ./
104+
fail-on-incorrect-version: true
105+
106+
git-secrets:
107+
runs-on: ubuntu-latest
108+
steps:
109+
- uses: actions/checkout@v3
110+
- name: Checkout awslabs/git-secrets
111+
uses: actions/checkout@v3
112+
with:
113+
repository: awslabs/git-secrets
114+
ref: master
115+
path: git-secrets
116+
- name: Install git-secrets
117+
run: cd git-secrets && sudo make install && cd ..
118+
- name: Run git-secrets
119+
run: |
120+
git-secrets --register-aws
121+
git-secrets --scan

.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

.gitmodules

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
[submodule "components/esp_secure_cert_mgr"]
2-
path = components/esp_secure_cert_mgr
3-
url = https://github.com/espressif/esp_secure_cert_mgr.git
4-
[submodule "components/esp-aws-iot"]
5-
path = components/esp-aws-iot
6-
url = https://github.com/espressif/esp-aws-iot
71
[submodule "components/FreeRTOS-Libraries-Integration-Tests/FreeRTOS-Libraries-Integration-Tests"]
82
path = components/FreeRTOS-Libraries-Integration-Tests/FreeRTOS-Libraries-Integration-Tests
93
url = https://github.com/FreeRTOS/FreeRTOS-Libraries-Integration-Tests
4+
[submodule "components/esp-aws-iot"]
5+
path = components/esp-aws-iot
6+
url = https://github.com/espressif/esp-aws-iot.git

AWSSetup.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ In case you already have an AWS account and user created, you can skip steps 1 a
44
## 1 Sign up for an AWS account
55

66
1. Open https://portal.aws.amazon.com/billing/signup.
7-
2. Follow the online instructions. **NOTE:** Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad.
7+
2. Follow the online instructions. **NOTE:** Part of the sign-up procedure involves receiving a phone call and entering a verification code on the phone keypad.
88
3. Make a note of your AWS account number as it will be needed for the following steps.
99

1010
## 2 Create an Administrator IAM user and grant it permissions
1111

12-
It’s strongly recommended that you adhere to the best practice of using the `Administrator` IAM user. The following steps show you how to create and securely lock away the root user credentials. One should only sign in as the root user to perform a few [account and service management tasks](https://docs.aws.amazon.com/general/latest/gr/root-vs-iam.html#aws_tasks-that-require-root).
12+
It’s strongly recommended that you adhere to the best practice of using the `Administrator` IAM user. The following steps show you how to create and securely lock away the root user credentials. One should only sign in as the root user to perform a few [account and service management tasks](https://docs.aws.amazon.com/general/latest/gr/root-vs-iam.html#aws_tasks-that-require-root).
1313

1414
1. Sign in to the [IAM console](https://console.aws.amazon.com/iam/) as the account owner by choosing **Root user** and entering your AWS account email address. On the next page, enter your password.
1515
2. On the navigation bar, click your account name, and then click Account.
@@ -31,7 +31,7 @@ It’s strongly recommended that you adhere to the best practice of using the `A
3131
![image](https://user-images.githubusercontent.com/23126711/165860249-faa9da14-cd2e-4e33-b1a1-97f279149dee.png)
3232
![image](https://user-images.githubusercontent.com/23126711/165860274-6a3e30f3-a32d-4c49-806d-600b5e571e11.png)
3333

34-
8. For **User name**, enter `Administrator`. Select the check box next to **AWS Management Console access**. Then select **Custom password**, and then enter your new password in the text box.
34+
8. For **User name**, enter `Administrator`. Select the check box next to **AWS Management Console access**. Then select **Custom password**, and then enter your new password in the text box.
3535
9. (Optional) By default, AWS requires the new user to create a new password when first signing in. You can clear the check box next to **User must create a new password at next sign-in** to allow the new user to reset their password after they sign in.
3636

3737
![image](https://user-images.githubusercontent.com/23126711/165860310-579a0be4-8082-49c0-a6a9-1a7cf40b7088.png)
@@ -112,7 +112,7 @@ Your board must be registered with AWS IoT to communicate with the AWS Cloud. To
112112
"Effect": "Allow",
113113
"Action": "iot:Connect",
114114
"Resource":"arn:aws:iot:aws-region:aws-account-id:*"
115-
},
115+
},
116116
{
117117
"Effect": "Allow",
118118
"Action": "iot:Publish",

0 commit comments

Comments
 (0)