-
Notifications
You must be signed in to change notification settings - Fork 13
139 lines (130 loc) · 4.43 KB
/
lint_build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Firmware Build
on:
push:
branches:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# Fetch depth must be greater than the number of commits included in the push in order to
# compare against commit prior to merge. 15 is chosen as a reasonable default for the
# upper bound of commits in a single PR.
fetch-depth: 15
- name: Install clang-format
shell: bash
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
sudo apt install clang-format-17
- name: Check code formatting
shell: bash
run: |
git fetch --no-recurse-submodules
if [[ $GITHUB_EVENT_NAME == 'push' ]]; then
BASE=${{ github.event.before }}
else
BASE=origin/$GITHUB_BASE_REF
fi
git clang-format-17 --verbose --extensions c,h --diff --diffstat $BASE
linux_build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
architecture: 'x64'
- name: Install Linux deps
shell: bash
run: |
sudo apt install libssl-dev
- name: Build golioth_basics
shell: bash
run: |
cd examples/linux/golioth_basics
echo "#define GOLIOTH_PSK_ID \"device@project\"" > credentials.inc
echo "#define GOLIOTH_PSK \"secret\"" >> credentials.inc
./build.sh
- name: Build certificate_auth
shell: bash
run: |
cd examples/linux/certificate_auth
./build.sh
esp_idf_build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
architecture: 'x64'
- name: Build ESP-IDF cpp project
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v5.3
target: esp32
path: 'examples/esp_idf/cpp'
- name: Create empty certs/keys required by certificate_auth project
shell: bash
run: |
cd examples/esp_idf/certificate_auth
mkdir -p main/certs
cd main
touch certs/client.key.pem
touch certs/client.crt.pem
- name: Build ESP-IDF certificate_auth project
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v5.3
target: esp32
path: 'examples/esp_idf/certificate_auth'
modus_toolbox_build:
runs-on: ubuntu-latest
env:
MTB_VERSION: 2.4.0.5972
MTB_TOOLS_VERSION: 2.4
MTB_DOWNLOAD_ID: 1x_YeXR4XSjaf-NZimKxQ8MIyDGo72yHt
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.x
architecture: 'x64'
- name: Download and install ModusToolbox 2.4
shell: bash
run: |
pip install click gdown==5.1.0 cryptography==41.0.7 intelhex cbor
gdown $MTB_DOWNLOAD_ID -O /tmp/ModusToolbox_$MTB_VERSION-linux-install.tar.gz
tar -C $HOME -zxf /tmp/ModusToolbox_$MTB_VERSION-linux-install.tar.gz
rm /tmp/ModusToolbox_$MTB_VERSION-linux-install.tar.gz
$HOME/ModusToolbox/tools_$MTB_TOOLS_VERSION/modus-shell/postinstall
- name: Build MTB golioth_basics project
shell: bash
run: |
# Ref:
# https://community.infineon.com/t5/ModusToolbox-General/ModusToolbox-Project-Creator-and-Library-Manager-report-no-Internet-connection/td-p/347593
export CyRemoteManifestOverride=\
https://github.com/cypresssemiconductorco/mtb-super-manifest/raw/v2.X/mtb-super-manifest-fv2.xml
export CY_TOOLS_PATHS=$HOME/ModusToolbox/tools_$MTB_TOOLS_VERSION
cd examples/modus_toolbox/golioth_basics/golioth_app
cp source/credentials.inc.template source/credentials.inc
make getlibs
make build -j$(nproc)