Skip to content

Commit 4de1835

Browse files
Merge pull request #11 from bradleysmith23/main
Add github actions workflow
2 parents fcf6cda + 9191cac commit 4de1835

31 files changed

+2051
-1316
lines changed

.github/.cSpellWords.txt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
CBMC
2+
CBOR
3+
Cbor
4+
DCMOCK
5+
DNDEBUG
6+
MISRA
7+
MQTT
8+
TINYCBOR
9+
cbmc
10+
cbor
11+
cborencoder
12+
cborerrorstrings
13+
cborparser
14+
cborpretty
15+
cmock
16+
coverity
17+
ctest
18+
misra
19+
mqtt
20+
sizet
21+
stringz
22+
tinycbor
23+
utest

.github/CONTRIBUTING.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Contributing Guidelines
2+
3+
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4+
documentation, we greatly value feedback and contributions from our community.
5+
6+
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7+
information to effectively respond to your bug report or contribution.
8+
9+
10+
## Reporting Bugs/Feature Requests
11+
12+
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
13+
14+
When filing an issue, please check [existing open](https://github.com/aws/Jobs-for-AWS-IoT-embedded-sdk/issues), or [recently closed](https://github.com/aws/Jobs-for-AWS-IoT-embedded-sdk/issues?q=is%3Aissue+is%3Aclosed), issues to make sure somebody else hasn't already
15+
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16+
17+
* A reproducible test case or series of steps
18+
* The version of our code being used
19+
* Any modifications you've made relevant to the bug
20+
* Anything unusual about your environment or deployment
21+
22+
23+
## Contributing via Pull Requests
24+
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
25+
26+
1. You are working against the latest source on the *main* branch.
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.
29+
30+
To send us a pull request, please:
31+
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.
40+
41+
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
42+
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
43+
44+
45+
## Finding contributions to work on
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/aws/Jobs-for-AWS-IoT-embedded-sdk/labels?q=help+wanted) issues is a great place to start.
47+
48+
49+
## Code of Conduct
50+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
51+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
52+
[email protected] with any additional questions or comments.
53+
54+
55+
## Security issue notifications
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.
57+
58+
59+
## Licensing
60+
61+
See the [LICENSE](../LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
62+
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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"lib_name": "AWS IOT Core MQTT File Stream Embedded C",
3+
"src": [
4+
"source/MQTTFileDownloader.c",
5+
"source/MQTTFileDownloader_cbor.c",
6+
"source/MQTTFileDownloader_base64.c",
7+
"coreJSON/source/core_json.c",
8+
"tinycbor/src/cborparser.c",
9+
"tinycbor/src/cborencoder.c",
10+
"tinycbor/src/cborencoder_close_container_checked.c"
11+
],
12+
"include": [
13+
"source/include",
14+
"coreJSON/source/include",
15+
"tinycbor/src"
16+
]
17+
}

.github/workflows/ci.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: CI Checks
2+
on:
3+
push:
4+
branches: ["**"]
5+
pull_request:
6+
branches: [main]
7+
workflow_dispatch:
8+
jobs:
9+
unittest:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Clone This Repo
13+
uses: actions/checkout@v3
14+
- name: Build
15+
run: |
16+
sudo apt-get install -y lcov sed
17+
cmake -S test -B build/ \
18+
-G "Unix Makefiles" \
19+
-DCMAKE_BUILD_TYPE=Debug \
20+
-DCMAKE_C_FLAGS='--coverage -Wall -Wextra'
21+
make -C build/ all
22+
- name: Test
23+
run: |
24+
cd build/
25+
ctest -E system --output-on-failure
26+
cd ..
27+
- name: Run Coverage
28+
run: |
29+
make -C build/ coverage
30+
declare -a EXCLUDE=("\*test\*" "\*CMakeCCompilerId\*" "\*mocks\*" "\*vendor/unity\*" "\*_deps\*")
31+
echo ${EXCLUDE[@]} | xargs lcov --rc lcov_branch_coverage=1 -r build/coverage.info -o build/coverage.info
32+
lcov --rc lcov_branch_coverage=1 --list build/coverage.info
33+
- name: Check Coverage
34+
uses: FreeRTOS/CI-CD-Github-Actions/coverage-cop@main
35+
with:
36+
coverage-file: ./build/coverage.info
37+
branch-coverage-min: 93
38+
complexity:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v3
42+
- name: Check complexity
43+
uses: FreeRTOS/CI-CD-Github-Actions/complexity@main
44+
with:
45+
path: ./
46+
horrid_threshold: 32
47+
doxygen:
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v3
51+
- name: Run doxygen build
52+
uses: FreeRTOS/CI-CD-Github-Actions/doxygen@main
53+
with:
54+
path: ./
55+
spell-check:
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Clone This Repo
59+
uses: actions/checkout@v3
60+
- name: Run spellings check
61+
uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
62+
with:
63+
path: ./
64+
formatting:
65+
runs-on: ubuntu-20.04
66+
steps:
67+
- uses: actions/checkout@v3
68+
- name: Check formatting
69+
uses: FreeRTOS/CI-CD-Github-Actions/formatting@main
70+
with:
71+
path: ./
72+
git-secrets:
73+
runs-on: ubuntu-latest
74+
steps:
75+
- uses: actions/checkout@v3
76+
- name: Checkout awslabs/git-secrets
77+
uses: actions/checkout@v3
78+
with:
79+
repository: awslabs/git-secrets
80+
ref: master
81+
path: git-secrets
82+
- name: Install git-secrets
83+
run: cd git-secrets && sudo make install && cd ..
84+
- name: Run git-secrets
85+
run: |
86+
git-secrets --register-aws
87+
git-secrets --scan
88+
memory_statistics:
89+
runs-on: ubuntu-latest
90+
steps:
91+
- uses: actions/checkout@v3
92+
- name: Clone coreJSON
93+
run: git clone https://github.com/FreeRTOS/coreJSON.git --depth 1 --branch v3.2.0
94+
- name: Clone tinycbor
95+
run: git clone https://github.com/intel/tinycbor.git --depth 1 --branch main
96+
- name: Install Python3
97+
uses: actions/setup-python@v3
98+
with:
99+
python-version: "3.11.0"
100+
- name: Measure sizes
101+
uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main
102+
with:
103+
config: .github/memory_statistics_config.json
104+
check_against: docs/doxygen/include/size_table.md
105+
106+
link-verifier:
107+
runs-on: ubuntu-latest
108+
steps:
109+
- uses: actions/checkout@v3
110+
- name: Check Links
111+
env:
112+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
113+
uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main
114+
115+
verify-manifest:
116+
runs-on: ubuntu-latest
117+
steps:
118+
- uses: actions/checkout@v3
119+
with:
120+
sparse-checkout: .
121+
122+
- name: Run manifest verifier
123+
uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@main
124+
with:
125+
path: ./
126+
fail-on-incorrect-version: true
127+
128+
proof_ci:
129+
if: ${{ github.event.pull_request }}
130+
runs-on: ubuntu-latest
131+
steps:
132+
- name: Set up CBMC runner
133+
uses: FreeRTOS/CI-CD-Github-Actions/set_up_cbmc_runner@main
134+
- name: Run CBMC
135+
uses: FreeRTOS/CI-CD-Github-Actions/run_cbmc@main
136+
with:
137+
proofs_dir: test/cbmc
138+
run_cbmc_proofs_command: ./run_proofs.sh

.github/workflows/formatting.yml

Lines changed: 23 additions & 0 deletions
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

.gitignore

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
build
1+
# Ignore documentation output.
2+
**/docs/**/output/*
3+
4+
# Ignore CMake build directory.
5+
build/
6+
7+
# Ignore build artifacts
8+
*.o
9+
10+
# Ignore code coverage artifacts
11+
*.gcda
12+
*.gcno
13+
*.gcov
14+
15+
#Ignore cbmc output
16+
run.json

.gitmodules

Whitespace-only changes.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## MQTT File Streams library
22

3-
In AWS IoT, a **stream** is a publicly addressable resource that is an abstraction for a list of files that can be transferred to an IoT device. Using MQTT file streams library, files from a stream can be transfer to an IoT device. The file is transfered using MQTT protocol. It supports both JSON and CBOR format to send requests and receive data.
3+
In AWS IoT, a **stream** is a publicly addressable resource that is an abstraction for a list of files that can be transferred to an IoT device. Using MQTT file streams library, files from a stream can be transfer to an IoT device. The file is transferred using MQTT protocol. It supports both JSON and CBOR format to send requests and receive data.
44

55
More information about streams and MQTT based file delivery can be found [here](https://docs.aws.amazon.com/iot/latest/developerguide/mqtt-based-file-delivery.html)
66

@@ -47,7 +47,7 @@ The [mqttFileDownloaderFilePaths.cmake](mqttFileDownloaderFilePaths.cmake) file
4747
To learn more about CBMC and proofs specifically, review the training material
4848
[here](https://model-checking.github.io/cbmc-training).
4949

50-
The `test/cbmc/proofs` directory contains CBMC proofs.
50+
The `test/cbmc` directory contains CBMC proofs.
5151

5252
In order to run these proofs you will need to install CBMC and other tools by
5353
following the instructions

cspell.config.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json
3+
version: '0.2'
4+
# Allows things like stringLength
5+
allowCompoundWords: true
6+
7+
# Read files not to spell check from the git ignore
8+
useGitignore: true
9+
10+
# Language settings for C
11+
languageSettings:
12+
- caseSensitive: false
13+
enabled: true
14+
languageId: c
15+
locale: "*"
16+
17+
# Add a dictionary, and the path to the word list
18+
dictionaryDefinitions:
19+
- name: freertos-words
20+
path: '.github/.cSpellWords.txt'
21+
addWords: true
22+
23+
dictionaries:
24+
- freertos-words
25+
26+
# Paths and files to ignore
27+
ignorePaths:
28+
- 'dependency'
29+
- 'docs'
30+
- 'ThirdParty'
31+
- 'History.txt'

0 commit comments

Comments
 (0)