|
33 | 33 | NEOPIXEL_VERSION: "1.15.2" |
34 | 34 |
|
35 | 35 | jobs: |
| 36 | + # ============================================================================ |
| 37 | + # DETECT CHANGES | 检测文件变化 |
| 38 | + # ============================================================================ |
| 39 | + |
| 40 | + detect-changes: |
| 41 | + runs-on: ubuntu-latest |
| 42 | + outputs: |
| 43 | + library: ${{ steps.filter.outputs.library }} |
| 44 | + iot-button: ${{ steps.filter.outputs.iot-button }} |
| 45 | + camera-stream: ${{ steps.filter.outputs.camera-stream }} |
| 46 | + reterminal-e1001: ${{ steps.filter.outputs.reterminal-e1001 }} |
| 47 | + reterminal-e1002: ${{ steps.filter.outputs.reterminal-e1002 }} |
| 48 | + wifi-provisioning: ${{ steps.filter.outputs.wifi-provisioning }} |
| 49 | + button-switch: ${{ steps.filter.outputs.button-switch }} |
| 50 | + led-switch: ${{ steps.filter.outputs.led-switch }} |
| 51 | + ha-state-subscribe: ${{ steps.filter.outputs.ha-state-subscribe }} |
| 52 | + temp-humidity: ${{ steps.filter.outputs.temp-humidity }} |
| 53 | + steps: |
| 54 | + - uses: actions/checkout@v4 |
| 55 | + - uses: dorny/paths-filter@v3 |
| 56 | + id: filter |
| 57 | + with: |
| 58 | + filters: | |
| 59 | + library: |
| 60 | + - 'arduino/SeeedHADiscovery/src/**' |
| 61 | + - 'arduino/SeeedHADiscovery/library.*' |
| 62 | + - '.github/workflows/build-firmware.yml' |
| 63 | + iot-button: |
| 64 | + - 'arduino/SeeedHADiscovery/examples/IoTButtonV2_DeepSleep/**' |
| 65 | + camera-stream: |
| 66 | + - 'arduino/SeeedHADiscovery/examples/CameraStream/**' |
| 67 | + reterminal-e1001: |
| 68 | + - 'arduino/SeeedHADiscovery/examples/reTerminal_E1001_HASubscribe_Display/**' |
| 69 | + reterminal-e1002: |
| 70 | + - 'arduino/SeeedHADiscovery/examples/reTerminal_E1002_HASubscribe_Display/**' |
| 71 | + wifi-provisioning: |
| 72 | + - 'arduino/SeeedHADiscovery/examples/WiFiProvisioning/**' |
| 73 | + button-switch: |
| 74 | + - 'arduino/SeeedHADiscovery/examples/ButtonSwitch/**' |
| 75 | + led-switch: |
| 76 | + - 'arduino/SeeedHADiscovery/examples/LEDSwitch/**' |
| 77 | + ha-state-subscribe: |
| 78 | + - 'arduino/SeeedHADiscovery/examples/HAStateSubscribe/**' |
| 79 | + temp-humidity: |
| 80 | + - 'arduino/SeeedHADiscovery/examples/TemperatureHumidity/**' |
| 81 | +
|
36 | 82 | # ============================================================================ |
37 | 83 | # SEEED-SPECIFIC FIRMWARE | SEEED 专用固件 |
38 | 84 | # ============================================================================ |
39 | 85 |
|
40 | 86 | # IoT Button V2 - XIAO ESP32-C6 only |
41 | 87 | build-iot-button: |
| 88 | + needs: detect-changes |
| 89 | + if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.library == 'true' || needs.detect-changes.outputs.iot-button == 'true' }} |
42 | 90 | runs-on: ubuntu-latest |
43 | 91 | steps: |
44 | 92 | - uses: actions/checkout@v4 |
|
81 | 129 |
|
82 | 130 | # Camera Stream - XIAO ESP32-S3 Sense only |
83 | 131 | build-camera-stream: |
| 132 | + needs: detect-changes |
| 133 | + if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.library == 'true' || needs.detect-changes.outputs.camera-stream == 'true' }} |
84 | 134 | runs-on: ubuntu-latest |
85 | 135 | steps: |
86 | 136 | - uses: actions/checkout@v4 |
@@ -121,6 +171,8 @@ jobs: |
121 | 171 |
|
122 | 172 | # reTerminal E1001 - ESP32-S3 based |
123 | 173 | build-reterminal-e1001: |
| 174 | + needs: detect-changes |
| 175 | + if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.library == 'true' || needs.detect-changes.outputs.reterminal-e1001 == 'true' }} |
124 | 176 | runs-on: ubuntu-latest |
125 | 177 | steps: |
126 | 178 | - uses: actions/checkout@v4 |
@@ -164,6 +216,8 @@ jobs: |
164 | 216 |
|
165 | 217 | # reTerminal E1002 - ESP32-S3 based |
166 | 218 | build-reterminal-e1002: |
| 219 | + needs: detect-changes |
| 220 | + if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.library == 'true' || needs.detect-changes.outputs.reterminal-e1002 == 'true' }} |
167 | 221 | runs-on: ubuntu-latest |
168 | 222 | steps: |
169 | 223 | - uses: actions/checkout@v4 |
@@ -211,6 +265,8 @@ jobs: |
211 | 265 |
|
212 | 266 | # WiFi Provisioning - Universal (using XIAO boards for D-pin compatibility) |
213 | 267 | build-wifi-provisioning: |
| 268 | + needs: detect-changes |
| 269 | + if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.library == 'true' || needs.detect-changes.outputs.wifi-provisioning == 'true' }} |
214 | 270 | runs-on: ubuntu-latest |
215 | 271 | strategy: |
216 | 272 | fail-fast: false |
@@ -259,6 +315,8 @@ jobs: |
259 | 315 |
|
260 | 316 | # Button Switch - Universal (using XIAO boards for D-pin compatibility) |
261 | 317 | build-button-switch: |
| 318 | + needs: detect-changes |
| 319 | + if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.library == 'true' || needs.detect-changes.outputs.button-switch == 'true' }} |
262 | 320 | runs-on: ubuntu-latest |
263 | 321 | strategy: |
264 | 322 | fail-fast: false |
@@ -308,6 +366,8 @@ jobs: |
308 | 366 | # LED Switch - Universal (using XIAO boards for LED_BUILTIN compatibility) |
309 | 367 | # Note: XIAO ESP32-C3 has no user LED, so C3 is excluded |
310 | 368 | build-led-switch: |
| 369 | + needs: detect-changes |
| 370 | + if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.library == 'true' || needs.detect-changes.outputs.led-switch == 'true' }} |
311 | 371 | runs-on: ubuntu-latest |
312 | 372 | strategy: |
313 | 373 | fail-fast: false |
@@ -353,6 +413,8 @@ jobs: |
353 | 413 |
|
354 | 414 | # HA State Subscribe - Universal (using XIAO boards) |
355 | 415 | build-ha-state-subscribe: |
| 416 | + needs: detect-changes |
| 417 | + if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.library == 'true' || needs.detect-changes.outputs.ha-state-subscribe == 'true' }} |
356 | 418 | runs-on: ubuntu-latest |
357 | 419 | strategy: |
358 | 420 | fail-fast: false |
@@ -401,6 +463,8 @@ jobs: |
401 | 463 |
|
402 | 464 | # Temperature Humidity - Universal (using XIAO boards) |
403 | 465 | build-temp-humidity: |
| 466 | + needs: detect-changes |
| 467 | + if: ${{ github.event_name == 'workflow_dispatch' || needs.detect-changes.outputs.library == 'true' || needs.detect-changes.outputs.temp-humidity == 'true' }} |
404 | 468 | runs-on: ubuntu-latest |
405 | 469 | strategy: |
406 | 470 | fail-fast: false |
@@ -452,8 +516,8 @@ jobs: |
452 | 516 | # ============================================================================ |
453 | 517 |
|
454 | 518 | combine: |
455 | | - needs: [build-iot-button, build-camera-stream, build-wifi-provisioning, build-button-switch, build-led-switch, build-ha-state-subscribe, build-temp-humidity] |
456 | | - if: always() |
| 519 | + needs: [detect-changes, build-iot-button, build-camera-stream, build-reterminal-e1001, build-reterminal-e1002, build-wifi-provisioning, build-button-switch, build-led-switch, build-ha-state-subscribe, build-temp-humidity] |
| 520 | + if: always() && !cancelled() |
457 | 521 | runs-on: ubuntu-latest |
458 | 522 | steps: |
459 | 523 | - name: Download all artifacts |
|
0 commit comments