1717jobs :
1818 # Stage 1: Branch Development Pipeline
1919 branch-pipeline :
20- name : Branch Pipeline (Unit Test + Compile + Coverage + SonarQube)
20+ name : Branch Pipeline (Compile + SonarQube)
2121 runs-on : ubuntu-latest
2222 if : github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/main')
2323 steps :
@@ -44,19 +44,19 @@ jobs:
4444 - name : Install dependencies
4545 run : |
4646 pip install --upgrade platformio
47- pip install gcovr==7.2
4847 sudo apt-get install build-essential bc jq
4948
50- - name : Run unit tests (native)
51- run : pio test -e native -f test_ota_simple -f test_wifi_simple -f test_utils_simple -f test_constants_simple
5249
53- - name : Compile project
54- run : pio run -e ttgo-lora32-v1-release
50+ - name : Compile project (ttgo-lora32-v1)
51+ run : pio run -e ttgo-lora32-v1
52+
53+ - name : Compile project (minimal)
54+ run : pio run -e minimal
5555
5656 - name : Check flash size limit
5757 run : |
5858 # Get build output and extract flash usage
59- pio run -e ttgo-lora32-v1-release 2>&1 | tee build_output.log
59+ pio run -e ttgo-lora32-v1 2>&1 | tee build_output.log
6060
6161 # Extract flash usage from build output
6262 FLASH_USED=$(grep -oP 'Flash:.*used \K\d+' build_output.log | tail -n 1)
@@ -91,22 +91,16 @@ jobs:
9191 with :
9292 name : build-artifacts-branch-${{ github.sha }}
9393 path : |
94- .pio/build/ttgo-lora32-v1-release/firmware.map
95- .pio/build/ttgo-lora32-v1-release/firmware.elf
94+ .pio/build/ttgo-lora32-v1/firmware.map
95+ .pio/build/ttgo-lora32-v1/firmware.elf
96+ .pio/build/minimal/firmware.map
97+ .pio/build/minimal/firmware.elf
9698 retention-days : 30
9799 if : always()
98100
99101 - name : Generate Compilation DB
100102 run : pio run -t compiledb
101103
102- - name : Generate coverage report
103- run : |
104- gcovr \
105- --root . \
106- --exclude '\.pio/libdeps/' \
107- --exclude 'tests/.*' \
108- --sonarqube \
109- --output coverage.xml
110104
111105 - name : SonarQube Scan
112106 uses : SonarSource/sonarqube-scan-action@v5
@@ -115,11 +109,10 @@ jobs:
115109 with :
116110 args : >
117111 --define sonar.cfamily.compile-commands="compile_commands.json"
118- --define sonar.coverageReportPaths="coverage.xml"
119112
120113 # Stage 2: Main Branch Pipeline
121114 main-pipeline :
122- name : Main Pipeline (Unit Test + Compile + Coverage + SonarQube)
115+ name : Main Pipeline (Compile + SonarQube)
123116 runs-on : ubuntu-latest
124117 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
125118 steps :
@@ -146,19 +139,18 @@ jobs:
146139 - name : Install dependencies
147140 run : |
148141 pip install --upgrade platformio
149- pip install gcovr==7.2
150142 sudo apt-get install build-essential bc jq
151143
152- - name : Run unit tests (native )
153- run : pio test -e native -f test_ota_simple -f test_wifi_simple -f test_utils_simple -f test_constants_simple
144+ - name : Compile project (ttgo-lora32-v1 )
145+ run : pio run -e ttgo-lora32-v1
154146
155- - name : Compile project
156- run : pio run -e ttgo-lora32-v1-release
147+ - name : Compile project (minimal)
148+ run : pio run -e minimal
157149
158150 - name : Check flash size limit
159151 run : |
160152 # Get build output and extract flash usage
161- pio run -e ttgo-lora32-v1-release 2>&1 | tee build_output.log
153+ pio run -e ttgo-lora32-v1 2>&1 | tee build_output.log
162154
163155 # Extract flash usage from build output
164156 FLASH_USED=$(grep -oP 'Flash:.*used \K\d+' build_output.log | tail -n 1)
@@ -193,31 +185,23 @@ jobs:
193185 with :
194186 name : build-artifacts-main-${{ github.sha }}
195187 path : |
196- .pio/build/ttgo-lora32-v1-release/firmware.map
197- .pio/build/ttgo-lora32-v1-release/firmware.elf
188+ .pio/build/ttgo-lora32-v1/firmware.map
189+ .pio/build/ttgo-lora32-v1/firmware.elf
190+ .pio/build/minimal/firmware.map
191+ .pio/build/minimal/firmware.elf
198192 retention-days : 30
199193 if : always()
200194
201195 - name : Generate Compilation DB
202196 run : pio run -t compiledb
203197
204- - name : Generate coverage report
205- run : |
206- gcovr \
207- --root . \
208- --exclude '\.pio/libdeps/' \
209- --exclude 'tests/.*' \
210- --sonarqube \
211- --output coverage.xml
212-
213198 - name : SonarQube Scan
214199 uses : SonarSource/sonarqube-scan-action@v5
215200 env :
216201 SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
217202 with :
218203 args : >
219204 --define sonar.cfamily.compile-commands="compile_commands.json"
220- --define sonar.coverageReportPaths="coverage.xml"
221205
222206 # Stage 3: Release Pipeline
223207 release-pipeline :
@@ -283,16 +267,17 @@ jobs:
283267 pip install --upgrade platformio
284268 sudo apt-get install build-essential bc jq
285269
286- - name : Run unit tests (native)
287- run : pio test -e native -f test_ota_simple -f test_wifi_simple -f test_utils_simple -f test_constants_simple
288270
289- - name : Compile with updated firmware version
290- run : pio run -e ttgo-lora32-v1-release
271+ - name : Compile with updated firmware version (ttgo-lora32-v1)
272+ run : pio run -e ttgo-lora32-v1
273+
274+ - name : Compile with updated firmware version (minimal)
275+ run : pio run -e minimal
291276
292277 - name : Check flash size limit
293278 run : |
294279 # Get build output and extract flash usage
295- pio run -e ttgo-lora32-v1-release 2>&1 | tee build_output.log
280+ pio run -e ttgo-lora32-v1 2>&1 | tee build_output.log
296281
297282 # Extract flash usage from build output
298283 FLASH_USED=$(grep -oP 'Flash:.*used \K\d+' build_output.log | tail -n 1)
@@ -325,10 +310,10 @@ jobs:
325310 - name : Create release artifacts
326311 run : |
327312 mkdir -p artifacts
328- cp .pio/build/ttgo-lora32-v1-release /firmware.bin artifacts/firmware-${{ steps.validate-tag.outputs.tag_name }}.bin
329- cp .pio/build/ttgo-lora32-v1-release /firmware.elf artifacts/firmware-${{ steps.validate-tag.outputs.tag_name }}.elf
330- cp .pio/build/ttgo-lora32-v1-release /firmware.map artifacts/firmware-${{ steps.validate-tag.outputs.tag_name }}.map
331- cp .pio/build/ttgo-lora32-v1-release /partitions.bin artifacts/partitions-${{ steps.validate-tag.outputs.tag_name }}.bin
313+ cp .pio/build/ttgo-lora32-v1/firmware.bin artifacts/firmware-${{ steps.validate-tag.outputs.tag_name }}.bin
314+ cp .pio/build/ttgo-lora32-v1/firmware.elf artifacts/firmware-${{ steps.validate-tag.outputs.tag_name }}.elf
315+ cp .pio/build/ttgo-lora32-v1/firmware.map artifacts/firmware-${{ steps.validate-tag.outputs.tag_name }}.map
316+ cp .pio/build/ttgo-lora32-v1/partitions.bin artifacts/partitions-${{ steps.validate-tag.outputs.tag_name }}.bin
332317
333318 # Create a manifest file with build info
334319 cat > artifacts/build-info-${{ steps.validate-tag.outputs.tag_name }}.json << EOF
0 commit comments