-
Notifications
You must be signed in to change notification settings - Fork 213
224 lines (217 loc) · 7.29 KB
/
documentation.yml
File metadata and controls
224 lines (217 loc) · 7.29 KB
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
# matth-x/MicroOcpp
# Copyright Matthias Akstaller 2019 - 2024
# MIT License
name: Documentation
on:
push:
branches:
- main
pull_request:
permissions:
contents: write
jobs:
measure_heap:
name: Heap measurements
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- name: Get build tools
run: |
sudo apt update
sudo apt install cmake libssl-dev build-essential
- name: Checkout Simulator
uses: actions/checkout@v3
with:
repository: matth-x/MicroOcppSimulator
path: MicroOcppSimulator
ref: 741733550b801d29261f81c3b7fb74bfc0b6faec
submodules: 'recursive'
- name: Clean MicroOcpp submodule
run: |
rm -rf MicroOcppSimulator/lib/MicroOcpp
- name: Checkout MicroOcpp submodule
uses: actions/checkout@v3
with:
path: MicroOcppSimulator/lib/MicroOcpp
- name: Generate CMake files
run: cmake -S ./MicroOcppSimulator -B ./MicroOcppSimulator/build -DCMAKE_CXX_FLAGS="-DMO_OVERRIDE_ALLOCATION=1 -DMO_ENABLE_HEAP_PROFILER=1"
- name: Compile
run: cmake --build ./MicroOcppSimulator/build -j 32 --target mo_simulator
- name: Install Python dependencies
run: pip install requests paramiko pandas
- name: Measure heap and create reports
run: |
mkdir -p docs/assets/tables
python tests/benchmarks/scripts/measure_heap.py
env:
TEST_DRIVER_URL: ${{ secrets.TEST_DRIVER_URL }}
TEST_DRIVER_CONFIG: ${{ secrets.TEST_DRIVER_CONFIG }}
TEST_DRIVER_KEY: ${{ secrets.TEST_DRIVER_KEY }}
TEST_DRIVER_CERT: ${{ secrets.TEST_DRIVER_CERT }}
MO_SIM_CONFIG: ${{ secrets.MO_SIM_CONFIG }}
MO_SIM_OCPP_SERVER: ${{ secrets.MO_SIM_OCPP_SERVER }}
MO_SIM_OCPP_CERT: ${{ secrets.MO_SIM_OCPP_CERT }}
MO_SIM_RMT_CTRL_CONFIG: ${{ secrets.MO_SIM_RMT_CTRL_CONFIG }}
MO_SIM_RMT_CTRL_CERT: ${{ secrets.MO_SIM_RMT_CTRL_CERT }}
- name: Upload reports
uses: actions/upload-artifact@v4
with:
name: Memory usage reports CSV
path: docs/assets/tables
if-no-files-found: error
build_firmware:
name: Build firmware
runs-on: ubuntu-latest
strategy:
matrix:
part: [v16, v201, v16_v201]
steps:
- uses: actions/checkout@v3
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v4
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Run PlatformIO
run: pio ci --lib="." --build-dir="${{ github.workspace }}/../build" --keep-build-dir --project-conf="./tests/benchmarks/firmware_size/platformio.ini" -e ${{ matrix.part }} ./tests/benchmarks/firmware_size/main.cpp
- name: Move firmware file # change path to location without parent dir ('..') statement (to make upload-artifact happy)
run: |
mkdir firmware
mv "${{ github.workspace }}/../build/.pio/build/${{ matrix.part }}/firmware.elf" "firmware/firmware_${{ matrix.part }}.elf"
- name: Upload firmware linker file
uses: actions/upload-artifact@v4
with:
name: Firmware linker file ${{ matrix.part }}
path: firmware
if-no-files-found: error
retention-days: 1
build_bloaty:
name: Build Google bloaty
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- name: Get build tools
run: |
sudo apt update
sudo apt install build-essential cmake ninja-build
sudo apt -y install gcc-9 g++-9
g++ --version
- name: Check out bloaty
uses: actions/checkout@v3
with:
repository: google/bloaty
ref: e1155149d54bb09b81e86f0e4e5cb7fbd2a318eb
path: tools/bloaty
submodules: recursive
- name: Install bloaty
run: |
cmake -B tools/bloaty/build -G Ninja -S tools/bloaty
cmake --build tools/bloaty/build -j 32
- name: Upload bloaty executable
uses: actions/upload-artifact@v4
with:
name: Google bloaty
path: tools/bloaty/build/bloaty
if-no-files-found: error
retention-days: 1
evaluate_firmware:
needs: [build_firmware, build_bloaty]
name: Static firmware analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- name: Set up Python
uses: actions/setup-python@v4
- name: Install Python dependencies
run: pip install pandas
- name: Get firmware linker file
uses: actions/download-artifact@v4
with:
name: Firmware linker file v16
path: firmware
- name: Get firmware linker file
uses: actions/download-artifact@v4
with:
name: Firmware linker file v201
path: firmware
- name: Get firmware linker file
uses: actions/download-artifact@v4
with:
name: Firmware linker file v16_v201
path: firmware
- name: Get bloaty executable
uses: actions/download-artifact@v4
with:
name: Google bloaty
path: tools/bloaty/build
- name: Run bloaty
run: |
mkdir -p docs/assets/tables
chmod +x tools/bloaty/build/bloaty
tools/bloaty/build/bloaty firmware/firmware_v16.elf -d compileunits --csv -n 0 > docs/assets/tables/bloaty_v16.csv
tools/bloaty/build/bloaty firmware/firmware_v201.elf -d compileunits --csv -n 0 > docs/assets/tables/bloaty_v201.csv
tools/bloaty/build/bloaty firmware/firmware_v16_v201.elf -d compileunits --csv -n 0 > docs/assets/tables/bloaty_v16_v201.csv
- name: Evaluate and create reports
run: python tests/benchmarks/scripts/eval_firmware_size.py
- name: Upload reports
uses: actions/upload-artifact@v4
with:
name: Firmware size reports CSV
path: docs/assets/tables
if-no-files-found: error
deploy:
needs: [evaluate_firmware, measure_heap]
name: Deploy docs
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: actions/cache@v4
with:
key: ${{ github.ref }}
path: .cache
- name: Install Python dependencies
run: pip install pandas mkdocs-material mkdocs-table-reader-plugin
- name: Get firmware size reports
uses: actions/download-artifact@v4
with:
name: Firmware size reports CSV
path: docs/assets/tables
- name: Get memory occupation reports
uses: actions/download-artifact@v4
with:
name: Memory usage reports CSV
path: docs/assets/tables
- name: Run mkdocs
run: mkdocs gh-deploy --force