Skip to content

Commit 91bdb3a

Browse files
committed
ci: Add build and QA check jobs
Signed-off-by: Devaraj Ranganna <[email protected]>
1 parent 9306c53 commit 91bdb3a

File tree

2 files changed

+133
-0
lines changed

2 files changed

+133
-0
lines changed

.github/workflows/build.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
- closed
12+
branches:
13+
- main
14+
workflow_dispatch:
15+
16+
jobs:
17+
ubuntu:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout project
21+
uses: actions/checkout@v2
22+
with:
23+
path: ${{ github.workspace }}
24+
submodules: 'recursive'
25+
- name: Install python 3
26+
uses: actions/setup-python@v2
27+
with:
28+
architecture: x64
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
- name: Install build dependencies
32+
shell: bash
33+
run: |
34+
pip install cmake ninja imgtool cffi intelhex cbor2 cbor jinja2 PyYaml
35+
- name: Install GNU Arm toolchain
36+
shell: bash
37+
run: |
38+
sudo apt-get -y update
39+
sudo apt-get -y install gcc-arm-none-eabi
40+
- name: Generate dummy device credentials
41+
shell: bash
42+
run: |
43+
export IOT_OTA_ENDPOINT="dummy_endpoint"
44+
export IOT_OTA_CLIENT_CERT="dummy_certificate"
45+
export IOT_OTA_CLIENT_PRIV="dummy_priv_key"
46+
export IOT_OTA_CLIENT_PUB="dummy_pub_key"
47+
./ci/generate_credentials.sh -f -p Config/aws_configs
48+
git config --global user.email "[email protected]"
49+
git config --global user.name "ci"
50+
- name: Build the project
51+
shell: bash
52+
run: |
53+
./Tools/scripts/build.sh aws-iot-example --toolchain GNU
54+
- name: Copy artifacts
55+
shell: bash
56+
run: |
57+
tar -czf gnu_build.tar.gz \
58+
build/bootloader/bl2.axf \
59+
build/secure_partition/tfm_s_signed.bin \
60+
build/Projects/aws-iot-example/aws-iot-example.axf \
61+
build/Projects/aws-iot-example/aws-iot-example_signed.bin \
62+
build/Projects/aws-iot-example/aws-iot-example-update_signed.bin \
63+
build/Projects/aws-iot-example/update-signature.txt
64+
- name: Upload Build Artifacts
65+
uses: actions/upload-artifact@v3
66+
with:
67+
name: FRI-build-logs
68+
path: |
69+
${{ github.workspace }}/gnu_build.tar.gz
70+
retention-days: 5

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI Checks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types:
9+
- opened
10+
- synchronize
11+
- closed
12+
branches:
13+
- main
14+
workflow_dispatch:
15+
16+
jobs:
17+
spell-check:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Clone This Repo
21+
uses: actions/checkout@v2
22+
- name: Run spellings check
23+
uses: FreeRTOS/CI-CD-Github-Actions/spellings@main
24+
with:
25+
path: ./
26+
27+
formatting:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- name: Install Uncrustify
32+
run: sudo apt-get install uncrustify
33+
- name: Run Uncrustify
34+
run: |
35+
uncrustify --version
36+
find Projects Config -iname "*.[hc]" -exec uncrustify --check -c Tools/uncrustify.cfg {} +
37+
- name: Check For Trailing Whitespace
38+
run: |
39+
set +e
40+
grep --exclude="README.md" --exclude-dir=Bsp --exclude-dir=Docs --exclude-dir=Middleware -rnI -e "[[:blank:]]$" .
41+
if [ "$?" = "0" ]; then
42+
echo "Files have trailing whitespace."
43+
exit 1
44+
else
45+
exit 0
46+
fi
47+
48+
git-secrets:
49+
runs-on: ubuntu-latest
50+
steps:
51+
- uses: actions/checkout@v2
52+
- name: Checkout awslabs/git-secrets
53+
uses: actions/checkout@v2
54+
with:
55+
repository: awslabs/git-secrets
56+
ref: master
57+
path: git-secrets
58+
- name: Install git-secrets
59+
run: cd git-secrets && sudo make install && cd ..
60+
- name: Run git-secrets
61+
run: |
62+
git-secrets --register-aws
63+
git-secrets --scan

0 commit comments

Comments
 (0)