@@ -13,8 +13,8 @@ permissions:
1313  contents : write 
1414
1515jobs :
16-   build_simulator :
17-     name : Build Simulator 
16+   measure_heap :
17+     name : Heap measurements 
1818    runs-on : ubuntu-latest 
1919    steps :
2020    - uses : actions/checkout@v3 
3434      with :
3535        repository : matth-x/MicroOcppSimulator 
3636        path : MicroOcppSimulator 
37-         ref : 2cb07cdbe53954a694a29336ab31eac2d2b48673 
37+         ref : 65b1c2e9c8a3f40907a823a0bc2f657423ebef65 
3838        submodules : ' recursive' 
3939    - name : Clean MicroOcpp submodule 
4040      run : | 
4747      run : cmake -S ./MicroOcppSimulator -B ./MicroOcppSimulator/build -DCMAKE_CXX_FLAGS="-DMO_OVERRIDE_ALLOCATION=1 -DMO_ENABLE_HEAP_PROFILER=1" 
4848    - name : Compile 
4949      run : cmake --build ./MicroOcppSimulator/build -j 32 --target mo_simulator 
50-     - name : Upload Simulator executable 
51-       uses : actions/upload-artifact@v4 
52-       with :
53-         name : Simulator executable 
54-         path : | 
55-           MicroOcppSimulator/build/mo_simulator 
56-           MicroOcppSimulator/public/bundle.html.gz 
57-          if-no-files-found : error 
58-         retention-days : 1 
59- 
60-   measure_heap :
61-     needs : build_simulator 
62-     name : Heap measurements 
63-     runs-on : ubuntu-latest 
64-     steps :
65-     - uses : actions/checkout@v3 
66-     - uses : actions/setup-python@v4 
67-       with :
68-         python-version : 3.x 
6950    - name : Install Python dependencies 
7051      run : pip install requests paramiko pandas 
71-     - name : Get Simulator 
72-       uses : actions/download-artifact@v4 
73-       with :
74-         name : Simulator executable 
75-         path : MicroOcppSimulator 
7652    - name : Measure heap and create reports 
7753      run : | 
7854        mkdir -p docs/assets/tables 
@@ -81,23 +57,25 @@ jobs:
8157        TEST_DRIVER_URL : ${{ secrets.TEST_DRIVER_URL }} 
8258        TEST_DRIVER_CONFIG : ${{ secrets.TEST_DRIVER_CONFIG }} 
8359        TEST_DRIVER_KEY : ${{ secrets.TEST_DRIVER_KEY }} 
60+         TEST_DRIVER_CERT : ${{ secrets.TEST_DRIVER_CERT }} 
8461        MO_SIM_CONFIG : ${{ secrets.MO_SIM_CONFIG }} 
8562        MO_SIM_OCPP_SERVER : ${{ secrets.MO_SIM_OCPP_SERVER }} 
86-         MO_SIM_API_CERT : ${{ secrets.MO_SIM_API_CERT }} 
87-         MO_SIM_API_KEY : ${{ secrets.MO_SIM_API_KEY }} 
88-         MO_SIM_API_CONFIG : ${{ secrets.MO_SIM_API_CONFIG }} 
89-         SSH_LOCAL_PRIV : ${{ secrets.SSH_LOCAL_PRIV }} 
90-         SSH_HOST_PUB : ${{ secrets.SSH_HOST_PUB }} 
63+         MO_SIM_OCPP_CERT : ${{ secrets.MO_SIM_OCPP_CERT }} 
64+         MO_SIM_RMT_CTRL_CONFIG : ${{ secrets.MO_SIM_RMT_CTRL_CONFIG }} 
65+         MO_SIM_RMT_CTRL_CERT : ${{ secrets.MO_SIM_RMT_CTRL_CERT }} 
9166    - name : Upload reports 
9267      uses : actions/upload-artifact@v4 
9368      with :
9469        name : Memory usage reports CSV 
9570        path : docs/assets/tables 
9671        if-no-files-found : error 
9772
98-   build_firmware_size :
73+   build_firmware :
9974    name : Build firmware 
10075    runs-on : ubuntu-latest 
76+     strategy :
77+       matrix :
78+         part : [v16, v201, v16_v201] 
10179    steps :
10280    - uses : actions/checkout@v3 
10381    - name : Cache pip 
@@ -119,35 +97,28 @@ jobs:
11997        python -m pip install --upgrade pip 
12098        pip install --upgrade platformio 
12199     - name : Run PlatformIO 
122-       run : pio ci --lib="." --build-dir="${{ github.workspace }}/../build" --keep-build-dir --project-conf="./tests/benchmarks/firmware_size/platformio.ini" ./tests/benchmarks/firmware_size/main.cpp 
123-     - name : Move firmware files   #  change path to location without parent dir ('..') statement (to make upload-artifact happy)
100+       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 
101+     - name : Move firmware file   #  change path to location without parent dir ('..') statement (to make upload-artifact happy)
124102      run : | 
125103        mkdir firmware 
126-         mv "${{ github.workspace }}/../build/.pio/build/v16/firmware.elf"  firmware/firmware_v16.elf 
127-         mv "${{ github.workspace }}/../build/.pio/build/v201/firmware.elf" firmware/firmware_v201.elf 
128-      - name : Upload firmware linker files 
104+         mv "${{ github.workspace }}/../build/.pio/build/${{ matrix.part }}/firmware.elf"  "firmware/firmware_${{ matrix.part }}.elf" 
105+      - name : Upload firmware linker file 
129106      uses : actions/upload-artifact@v4 
130107      with :
131-         name : Firmware linker files  
108+         name : Firmware linker file ${{ matrix.part }}  
132109        path : firmware 
133110        if-no-files-found : error 
134111        retention-days : 1 
135112
136-   evaluate_firmware :
137-     needs : build_firmware_size 
138-     name : Static firmware analysis 
113+   build_bloaty :
114+     name : Build Google bloaty 
139115    runs-on : ubuntu-latest 
140116    steps :
141117    - uses : actions/checkout@v3 
142-     - uses : actions/setup-python@v4 
143-       with :
144-         python-version : 3.x 
145118    - uses : actions/cache@v2 
146119      with :
147120        key : ${{ github.ref }} 
148121        path : .cache 
149-     - name : Install Python dependencies 
150-       run : pip install pandas  
151122    - name : Get build tools 
152123      run : | 
153124        sudo apt update 
@@ -165,16 +136,53 @@ jobs:
165136      run : | 
166137        cmake -B tools/bloaty/build -G Ninja -S tools/bloaty 
167138        cmake --build tools/bloaty/build -j 32 
168-      - name : Get firmware linker files 
139+      - name : Upload bloaty executable 
140+       uses : actions/upload-artifact@v4 
141+       with :
142+         name : Google bloaty 
143+         path : tools/bloaty/build/bloaty 
144+         if-no-files-found : error 
145+         retention-days : 1 
146+ 
147+   evaluate_firmware :
148+     needs : [build_firmware, build_bloaty] 
149+     name : Static firmware analysis 
150+     steps :
151+     - uses : actions/checkout@v3 
152+     - uses : actions/cache@v2 
153+       with :
154+         key : ${{ github.ref }} 
155+         path : .cache 
156+     - name : Set up Python 
157+       uses : actions/setup-python@v4 
158+     - name : Install Python dependencies 
159+       run : pip install pandas 
160+     - name : Get firmware linker file 
161+       uses : actions/download-artifact@v4 
162+       with :
163+         name : Firmware linker file v16 
164+         path : firmware 
165+     - name : Get firmware linker file 
166+       uses : actions/download-artifact@v4 
167+       with :
168+         name : Firmware linker file v201 
169+         path : firmware 
170+     - name : Get firmware linker file 
169171      uses : actions/download-artifact@v4 
170172      with :
171-         name : Firmware linker files  
173+         name : Firmware linker file v16_v201  
172174        path : firmware 
175+     - name : Get bloaty executable 
176+       uses : actions/download-artifact@v4 
177+       with :
178+         name : Google bloaty 
179+         path : tools/bloaty/build/bloaty 
173180    - name : Run bloaty 
174181      run : | 
175182        mkdir -p docs/assets/tables 
176183        tools/bloaty/build/bloaty firmware/firmware_v16.elf  -d compileunits --csv -n 0 > docs/assets/tables/bloaty_v16.csv 
177184        tools/bloaty/build/bloaty firmware/firmware_v201.elf -d compileunits --csv -n 0 > docs/assets/tables/bloaty_v201.csv 
185+         tools/bloaty/build/bloaty firmware/firmware_v16_v201.elf -d compileunits --csv -n 0 > docs/assets/tables/bloaty_v16_v201.csv 
178186     - name : Evaluate and create reports 
179187      run : python tests/benchmarks/scripts/eval_firmware_size.py 
180188    - name : Upload reports 
0 commit comments