@@ -15,31 +15,78 @@ jobs:
1515 # ============================================================================
1616 # Code Quality & Linting
1717 # ============================================================================
18- quality-check :
19- name : Arduino Lint Check
18+
19+ quality-check-linux :
20+ name : Arduino Lint Check (Linux)
2021 runs-on : ubuntu-latest
2122 timeout-minutes : 10
22-
2323 steps :
2424 - uses : actions/checkout@v5
25-
2625 - uses : arduino/setup-arduino-cli@v2
27-
28- - name : Cache Arduino Core
29- uses : actions/cache@v4
26+ - name : Restore Arduino Core Cache
27+ id : cache-core-linux
28+ uses : actions/cache/restore @v4
3029 with :
3130 path : |
3231 ~/.arduino15/packages
3332 ~/.arduino15/cache
34- key : arduino-core-${{ runner.os }} -esp32-v1
33+ key : arduino-core-linux -esp32-v1
3534 restore-keys : |
36- arduino-core-${{ runner.os }} -
37-
38- - name : Install ESP32 Core
35+ arduino-core-linux -
36+ - name : Ensure ESP32 Core is installed (Linux)
37+ shell : bash
3938 run : |
4039 arduino-cli core update-index --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
41- arduino-cli core install esp32:esp32
40+ if ! arduino-cli core list | grep -q 'esp32'; then
41+ arduino-cli core install esp32:esp32
42+ fi
43+ - name : Save Arduino Core Cache
44+ if : always() && steps.cache-core-linux.outputs.cache-hit != 'true'
45+ uses : actions/cache/save@v4
46+ with :
47+ path : |
48+ ~/.arduino15/packages
49+ ~/.arduino15/cache
50+ key : arduino-core-linux-esp32-v1
51+ - uses : arduino/arduino-lint-action@v2
52+ with :
53+ path : ${{ github.workspace }}
54+ compliance : strict
55+ library-manager : update
56+ verbose : true
4257
58+ quality-check-windows :
59+ name : Arduino Lint Check (Windows)
60+ runs-on : windows-latest
61+ timeout-minutes : 10
62+ steps :
63+ - uses : actions/checkout@v5
64+ - uses : arduino/setup-arduino-cli@v2
65+ - name : Restore Arduino Core Cache
66+ id : cache-core-win
67+ uses : actions/cache/restore@v4
68+ with :
69+ path : |
70+ ~/.arduino15/packages
71+ ~/.arduino15/cache
72+ key : arduino-core-windows-esp32-v1
73+ restore-keys : |
74+ arduino-core-windows-
75+ - name : Ensure ESP32 Core is installed (Windows)
76+ shell : pwsh
77+ run : |
78+ arduino-cli core update-index --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
79+ if (-not (arduino-cli core list | Select-String 'esp32')) {
80+ arduino-cli core install esp32:esp32
81+ }
82+ - name : Save Arduino Core Cache
83+ if : always() && steps.cache-core-win.outputs.cache-hit != 'true'
84+ uses : actions/cache/save@v4
85+ with :
86+ path : |
87+ ~/.arduino15/packages
88+ ~/.arduino15/cache
89+ key : arduino-core-windows-esp32-v1
4390 - uses : arduino/arduino-lint-action@v2
4491 with :
4592 path : ${{ github.workspace }}
@@ -50,59 +97,101 @@ jobs:
5097 # ============================================================================
5198 # Compilation Test
5299 # ============================================================================
53- compile-test :
54- name : Compile Example Sketches
100+
101+ compile-test-linux :
102+ name : Compile Sketches (Linux)
55103 runs-on : ubuntu-latest
56104 timeout-minutes : 15
57-
58- strategy :
59- fail-fast : false
60- matrix :
61- example :
62- - examples/dshot300/dshot300.ino
63- - examples/command_manager/command_manager.ino
64- - examples/web_control/web_control.ino
65- - examples/web_client/web_client.ino
66-
67105 steps :
68106 - uses : actions/checkout@v5
69-
70107 - uses : arduino/setup-arduino-cli@v2
71-
72- - name : Cache Arduino Core & Libraries
73- uses : actions/cache@v4
108+ - name : Restore Arduino Core & Libraries Cache
109+ id : cache-all-linux
110+ uses : actions/cache/restore @v4
74111 with :
75112 path : |
76113 ~/.arduino15/packages
77114 ~/.arduino15/cache
78115 ~/Arduino/libraries
79- key : arduino-full-${{ runner.os }} -esp32-v1
116+ key : arduino-full-linux -esp32-v1
80117 restore-keys : |
81- arduino-full-${{ runner.os }} -
82-
83- - name : Install ESP32 Core and Dependencies
118+ arduino-full-linux -
119+ - name : Ensure ESP32 Core and Dependencies (Linux)
120+ shell : bash
84121 run : |
85122 arduino-cli core update-index --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
86- arduino-cli core install esp32:esp32
87- arduino-cli lib install "ArduinoJson"
88-
123+ if ! arduino-cli core list | grep -q ' esp32'; then
124+ arduino-cli core install esp32:esp32
125+ fi
89126 mkdir -p ~/Arduino/libraries
90-
91- # Cached repository check
127+ if [ ! -d ~/Arduino/libraries/ArduinoJson ]; then
128+ git clone --depth=1 https://github.com/bblanchon/ArduinoJson.git ~/Arduino/libraries/ArduinoJson
129+ fi
92130 if [ ! -d ~/Arduino/libraries/ESPAsyncWebServer ]; then
93131 git clone --depth=1 https://github.com/ESP32Async/ESPAsyncWebServer ~/Arduino/libraries/ESPAsyncWebServer
94132 fi
95-
96133 if [ ! -d ~/Arduino/libraries/AsyncTCP ]; then
97134 git clone --depth=1 https://github.com/ESP32Async/AsyncTCP ~/Arduino/libraries/AsyncTCP
98135 fi
136+ - name : Save Arduino Core & Libraries Cache
137+ if : always() && steps.cache-all-linux.outputs.cache-hit != 'true'
138+ uses : actions/cache/save@v4
139+ with :
140+ path : |
141+ ~/.arduino15/packages
142+ ~/.arduino15/cache
143+ ~/Arduino/libraries
144+ key : arduino-full-linux-esp32-v1
145+ - name : Compile Sketch
146+ run : |
147+ arduino-cli compile --fqbn esp32:esp32:esp32 --library ${{ github.workspace }} examples/dshot300/dshot300.ino
99148
149+ compile-test-windows :
150+ name : Compile Sketches (Windows)
151+ runs-on : windows-latest
152+ timeout-minutes : 15
153+ steps :
154+ - uses : actions/checkout@v5
155+ - uses : arduino/setup-arduino-cli@v2
156+ - name : Restore Arduino Core & Libraries Cache
157+ id : cache-all-win
158+ uses : actions/cache/restore@v4
159+ with :
160+ path : |
161+ ~/.arduino15/packages
162+ ~/.arduino15/cache
163+ ~/Arduino/libraries
164+ key : arduino-full-windows-esp32-v1
165+ restore-keys : |
166+ arduino-full-windows-
167+ - name : Ensure ESP32 Core and Dependencies (Windows)
168+ shell : pwsh
169+ run : |
170+ arduino-cli core update-index --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
171+ if (-not (arduino-cli core list | Select-String 'esp32')) {
172+ arduino-cli core install esp32:esp32
173+ }
174+ if (-not (Test-Path -Path "$env:USERPROFILE/Arduino/libraries/ArduinoJson")) {
175+ git clone --depth=1 https://github.com/bblanchon/ArduinoJson.git "$env:USERPROFILE/Arduino/libraries/ArduinoJson"
176+ }
177+ if (-not (Test-Path -Path "$env:USERPROFILE/Arduino/libraries/ESPAsyncWebServer")) {
178+ git clone --depth=1 https://github.com/ESP32Async/ESPAsyncWebServer "$env:USERPROFILE/Arduino/libraries/ESPAsyncWebServer"
179+ }
180+ if (-not (Test-Path -Path "$env:USERPROFILE/Arduino/libraries/AsyncTCP")) {
181+ git clone --depth=1 https://github.com/ESP32Async/AsyncTCP "$env:USERPROFILE/Arduino/libraries/AsyncTCP"
182+ }
183+ - name : Save Arduino Core & Libraries Cache
184+ if : always() && steps.cache-all-win.outputs.cache-hit != 'true'
185+ uses : actions/cache/save@v4
186+ with :
187+ path : |
188+ ~/.arduino15/packages
189+ ~/.arduino15/cache
190+ ~/Arduino/libraries
191+ key : arduino-full-windows-esp32-v1
100192 - name : Compile Sketch
101193 run : |
102- arduino-cli compile \
103- --fqbn esp32:esp32:esp32 \
104- --library ${{ github.workspace }} \
105- ${{ matrix.example }}
194+ arduino-cli compile --fqbn esp32:esp32:esp32 --library ${{ github.workspace }} examples/dshot300/dshot300.ino
106195
107196 # ============================================================================
108197 # Build Status Report
@@ -111,27 +200,31 @@ jobs:
111200 name : Build Summary
112201 runs-on : ubuntu-latest
113202 if : always()
114- needs : [quality-check, compile-test]
115-
203+ needs :
204+ - quality-check-linux
205+ - quality-check-windows
206+ - compile-test-linux
207+ - compile-test-windows
116208 steps :
117209 - name : Create Build Summary
118210 run : |
119211 echo "# 🔧 DShotRMT Build Report" >> $GITHUB_STEP_SUMMARY
120212 echo "| Check | Status | Details |" >> $GITHUB_STEP_SUMMARY
121213 echo "|-------|--------|---------|" >> $GITHUB_STEP_SUMMARY
122214
123- [[ "${{ needs.quality-check.result }}" == "success" ]] \
215+ [[ "${{ needs.quality-check-linux.result }}" == "success" && "${{ needs.quality-check-windows .result }}" == "success" ]] \
124216 && echo "| 📋 Quality Check | ✅ Passed | Arduino Lint completed successfully |" >> $GITHUB_STEP_SUMMARY \
125217 || echo "| 📋 Quality Check | ❌ Failed | Check Arduino Lint report |" >> $GITHUB_STEP_SUMMARY
126218
127- [[ "${{ needs.compile-test.result }}" == "success" ]] \
219+ [[ "${{ needs.compile-test-linux.result }}" == "success" && "${{ needs.compile-test-windows .result }}" == "success" ]] \
128220 && echo "| 🔨 Compilation | ✅ Passed | All examples compiled successfully |" >> $GITHUB_STEP_SUMMARY \
129221 || echo "| 🔨 Compilation | ❌ Failed | Compilation errors detected |" >> $GITHUB_STEP_SUMMARY
130222
131223 echo "" >> $GITHUB_STEP_SUMMARY
132224
133- [[ "${{ needs.quality-check.result }}" == "success" && "${{ needs.compile-test.result }}" == "success" ]] \
225+ [[ "${{ needs.quality-check-linux .result }}" == "success" && "${{ needs.quality-check-windows.result }}" == "success" && "${{ needs. compile-test-linux.result }}" == "success" && "${{ needs.compile-test-windows .result }}" == "success" ]] \
134226 && echo "## 🎉 All Checks Passed!" >> $GITHUB_STEP_SUMMARY \
135227 && echo "Your DShotRMT library is ready for deployment." >> $GITHUB_STEP_SUMMARY \
136228 || echo "## ⚠️ Action Required" >> $GITHUB_STEP_SUMMARY \
137229 && echo "Please review the failed checks and address any issues." >> $GITHUB_STEP_SUMMARY
230+
0 commit comments