-
Notifications
You must be signed in to change notification settings - Fork 15
140 lines (131 loc) · 4.35 KB
/
ci-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
140
name: "CI: Firmware Build"
on:
push:
branches:
- main
pull_request:
jobs:
lint:
runs-on: ubuntu-24.04
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: |
pip install clang-format
- 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 --verbose --extensions c,h --diff --diffstat $BASE
linux_build:
runs-on: ubuntu-24.04
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-24.04
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-24.04
env:
MTB_VERSION: 3.3.0.16857
MTB_TOOLS_VERSION: 3.3
MTB_DOWNLOAD_ID: ${{ secrets.MTB_DOWNLOAD_ID }}
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 3.3
shell: bash
run: |
pip install click gdown==5.1.0 cryptography==41.0.7 intelhex cbor
sudo apt update && sudo apt install -y \
libxcb-xinerama0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxkbcommon-x11-0 \
libopengl0 \
libegl1
gdown $MTB_DOWNLOAD_ID -O /tmp/modustoolbox_${MTB_VERSION}_Linux_x64.deb
sudo dpkg -i /tmp/modustoolbox_${MTB_VERSION}_Linux_x64.deb
rm /tmp/modustoolbox_${MTB_VERSION}_Linux_x64.deb
- name: Build MTB golioth_basics project
shell: bash
run: |
export CY_TOOLS_PATHS=/opt/Tools/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)