From 402c25c65a8821e4f02f2ec0b70db73eb129b18f Mon Sep 17 00:00:00 2001 From: Alessio D'Ambrosio Date: Tue, 16 Jun 2026 20:42:23 +0200 Subject: [PATCH 1/3] ci: rework GitHub Actions workflows Consolidate firmware build, release, docs, and test workflows. - ci.yml: runs native unit tests and builds every PlatformIO environment via a dynamically generated, chunked build matrix (all 507 variants across all platforms, under the 256-job cap) - release.yml: tag-driven companion/repeater/room-server releases, selecting the build target from the tag prefix - docs.yml: MkDocs build and GitHub Pages deploy Removes the six previous single-purpose workflows. --- .../workflows/build-companion-firmwares.yml | 42 ---------- .../workflows/build-repeater-firmwares.yml | 42 ---------- .../workflows/build-room-server-firmwares.yml | 42 ---------- .github/workflows/ci.yml | 83 +++++++++++++++++++ .../workflows/{github-pages.yml => docs.yml} | 7 +- .github/workflows/pr-build-check.yml | 55 ------------ .github/workflows/release.yml | 66 +++++++++++++++ .github/workflows/run-unit-tests.yml | 31 ------- 8 files changed, 153 insertions(+), 215 deletions(-) delete mode 100644 .github/workflows/build-companion-firmwares.yml delete mode 100644 .github/workflows/build-repeater-firmwares.yml delete mode 100644 .github/workflows/build-room-server-firmwares.yml create mode 100644 .github/workflows/ci.yml rename .github/workflows/{github-pages.yml => docs.yml} (93%) delete mode 100644 .github/workflows/pr-build-check.yml create mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/run-unit-tests.yml diff --git a/.github/workflows/build-companion-firmwares.yml b/.github/workflows/build-companion-firmwares.yml deleted file mode 100644 index 771fa6d5bc..0000000000 --- a/.github/workflows/build-companion-firmwares.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build Companion Firmwares - -permissions: - contents: write - -on: - workflow_dispatch: - push: - tags: - - 'companion-*' - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - - name: Clone Repo - uses: actions/checkout@v6 - - - name: Setup Build Environment - uses: ./.github/actions/setup-build-environment - - - name: Build Firmwares - env: - FIRMWARE_VERSION: ${{ env.GIT_TAG_VERSION }} - run: /usr/bin/env bash build.sh build-companion-firmwares - - - name: Upload Workflow Artifacts - uses: actions/upload-artifact@v7 - with: - name: companion-firmwares - path: out - - - name: Create Release - uses: softprops/action-gh-release@v3 - if: startsWith(github.ref, 'refs/tags/') - with: - name: Companion Firmware ${{ env.GIT_TAG_VERSION }} - body: "" - draft: true - files: out/* \ No newline at end of file diff --git a/.github/workflows/build-repeater-firmwares.yml b/.github/workflows/build-repeater-firmwares.yml deleted file mode 100644 index 3185d4b21c..0000000000 --- a/.github/workflows/build-repeater-firmwares.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build Repeater Firmwares - -permissions: - contents: write - -on: - workflow_dispatch: - push: - tags: - - 'repeater-*' - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - - name: Clone Repo - uses: actions/checkout@v6 - - - name: Setup Build Environment - uses: ./.github/actions/setup-build-environment - - - name: Build Firmwares - env: - FIRMWARE_VERSION: ${{ env.GIT_TAG_VERSION }} - run: /usr/bin/env bash build.sh build-repeater-firmwares - - - name: Upload Workflow Artifacts - uses: actions/upload-artifact@v7 - with: - name: repeater-firmwares - path: out - - - name: Create Release - uses: softprops/action-gh-release@v3 - if: startsWith(github.ref, 'refs/tags/') - with: - name: Repeater Firmware ${{ env.GIT_TAG_VERSION }} - body: "" - draft: true - files: out/* \ No newline at end of file diff --git a/.github/workflows/build-room-server-firmwares.yml b/.github/workflows/build-room-server-firmwares.yml deleted file mode 100644 index 127095a8df..0000000000 --- a/.github/workflows/build-room-server-firmwares.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Build Room Server Firmwares - -permissions: - contents: write - -on: - workflow_dispatch: - push: - tags: - - 'room-server-*' - -jobs: - - build: - runs-on: ubuntu-latest - steps: - - - name: Clone Repo - uses: actions/checkout@v6 - - - name: Setup Build Environment - uses: ./.github/actions/setup-build-environment - - - name: Build Firmwares - env: - FIRMWARE_VERSION: ${{ env.GIT_TAG_VERSION }} - run: /usr/bin/env bash build.sh build-room-server-firmwares - - - name: Upload Workflow Artifacts - uses: actions/upload-artifact@v7 - with: - name: room-server-firmwares - path: out - - - name: Create Release - uses: softprops/action-gh-release@v3 - if: startsWith(github.ref, 'refs/tags/') - with: - name: Room Server Firmware ${{ env.GIT_TAG_VERSION }} - body: "" - draft: true - files: out/* \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..38a8436b0d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,83 @@ +name: CI + +on: + push: + branches: [main, dev] + pull_request: + branches: [main, dev] + workflow_dispatch: + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + + test: + name: Unit Tests + runs-on: ubuntu-latest + steps: + - name: Clone Repo + uses: actions/checkout@v6 + + - name: Setup Build Environment + uses: ./.github/actions/setup-build-environment + + - name: Run Unit Tests + run: pio test -e native -vv + + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v7 + with: + name: test-results + path: .pio/build/native/ + + generate-matrix: + name: Generate Build Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set.outputs.matrix }} + steps: + - name: Clone Repo + uses: actions/checkout@v6 + + - name: Setup Build Environment + uses: ./.github/actions/setup-build-environment + + - name: Generate Matrix + id: set + run: | + python3 - <<'EOF' >> "$GITHUB_OUTPUT" + import json, subprocess + data = json.loads(subprocess.check_output(["pio", "project", "config", "--json-output"])) + envs = sorted(s[4:] for s, _ in data if s.startswith("env:") and s != "env:native") + size = 4 + chunks = [" ".join(envs[i:i + size]) for i in range(0, len(envs), size)] + print("matrix=" + json.dumps({"chunk": chunks})) + EOF + + build: + name: Build + needs: generate-matrix + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} + steps: + - name: Clone Repo + uses: actions/checkout@v6 + + - name: Setup Build Environment + uses: ./.github/actions/setup-build-environment + + - name: Build Environments + run: | + for env in ${{ matrix.chunk }}; do + echo "::group::$env" + pio run -e "$env" + echo "::endgroup::" + done diff --git a/.github/workflows/github-pages.yml b/.github/workflows/docs.yml similarity index 93% rename from .github/workflows/github-pages.yml rename to .github/workflows/docs.yml index b01ddc939c..a11bd9b270 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/docs.yml @@ -1,19 +1,20 @@ -name: Build and deploy Docs site to GitHub Pages +name: Docs on: - workflow_dispatch: push: branches: - main + workflow_dispatch: permissions: contents: write jobs: + github-pages: + name: Build and Deploy Docs runs-on: ubuntu-latest steps: - - name: Checkout Repo uses: actions/checkout@v6 diff --git a/.github/workflows/pr-build-check.yml b/.github/workflows/pr-build-check.yml deleted file mode 100644 index 84fbc19598..0000000000 --- a/.github/workflows/pr-build-check.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: PR Build Check - -on: - pull_request: - branches: [main, dev] - paths: - - 'src/**' - - 'examples/**' - - 'variants/**' - - 'platformio.ini' - - '.github/workflows/pr-build-check.yml' - push: - branches: [main, dev] - paths: - - 'src/**' - - 'examples/**' - - 'variants/**' - - 'platformio.ini' - - '.github/workflows/pr-build-check.yml' - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - environment: - # ESP32-S3 (most common platform) - - Heltec_v3_companion_radio_ble - - Heltec_v3_repeater - - Heltec_v3_room_server - # nRF52 - - RAK_4631_companion_radio_ble - - RAK_4631_repeater - - RAK_4631_room_server - # RP2040 - - PicoW_repeater - # STM32 - - wio-e5-mini_repeater - # ESP32-C6 - - LilyGo_Tlora_C6_repeater_ - # LR1110 (nRF52) - - wio_wm1110_repeater - # SX1276 (ESP32) - - Tbeam_SX1276_repeater - - steps: - - name: Clone Repo - uses: actions/checkout@v6 - - - name: Setup Build Environment - uses: ./.github/actions/setup-build-environment - - - name: Build ${{ matrix.environment }} - run: pio run -e ${{ matrix.environment }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..a958d60404 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,66 @@ +name: Release Firmwares + +on: + workflow_dispatch: + push: + tags: + - 'companion-*' + - 'repeater-*' + - 'room-server-*' + +permissions: + contents: write + +jobs: + + release: + name: Build and Release + runs-on: ubuntu-latest + steps: + - name: Clone Repo + uses: actions/checkout@v6 + + - name: Setup Build Environment + uses: ./.github/actions/setup-build-environment + + - name: Determine Build Target + id: target + run: | + case "${GITHUB_REF_NAME}" in + companion-*) + echo "cmd=build-companion-firmwares" >> "$GITHUB_OUTPUT" + echo "name=Companion Firmware" >> "$GITHUB_OUTPUT" + ;; + repeater-*) + echo "cmd=build-repeater-firmwares" >> "$GITHUB_OUTPUT" + echo "name=Repeater Firmware" >> "$GITHUB_OUTPUT" + ;; + room-server-*) + echo "cmd=build-room-server-firmwares" >> "$GITHUB_OUTPUT" + echo "name=Room Server Firmware" >> "$GITHUB_OUTPUT" + ;; + *) + echo "cmd=build-firmwares" >> "$GITHUB_OUTPUT" + echo "name=Firmware" >> "$GITHUB_OUTPUT" + ;; + esac + + - name: Build Firmwares + env: + FIRMWARE_VERSION: ${{ env.GIT_TAG_VERSION || 'dev' }} + run: /usr/bin/env bash build.sh ${{ steps.target.outputs.cmd }} + + - name: Upload Workflow Artifacts + uses: actions/upload-artifact@v7 + with: + name: firmwares + path: out + + - name: Create Release + uses: softprops/action-gh-release@v3 + if: startsWith(github.ref, 'refs/tags/') + with: + name: ${{ steps.target.outputs.name }} ${{ env.GIT_TAG_VERSION }} + body: "" + draft: true + files: out/* diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml deleted file mode 100644 index e3af3aafbf..0000000000 --- a/.github/workflows/run-unit-tests.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Run Unit Tests - -on: - push: - branches: - - main - - master - pull_request: - workflow_dispatch: - -jobs: - test: - runs-on: ubuntu-latest - steps: - - - name: Clone Repo - uses: actions/checkout@v4 - - - name: Setup Build Environment - uses: ./.github/actions/setup-build-environment - - - name: Run Unit Tests - run: pio test -e native -vv - - - name: Upload Test Results - # Upload test results even if the test step failed. - if: always() - uses: actions/upload-artifact@v4 - with: - name: test-results - path: .pio/build/native/ From ca21c87f8cb6deba41c98deb4bb12bdf0c6caab9 Mon Sep 17 00:00:00 2001 From: Alessio D'Ambrosio Date: Tue, 16 Jun 2026 20:49:19 +0200 Subject: [PATCH 2/3] ci: build a representative subset instead of all variants Replace the full 507-environment build matrix with one representative environment per platform and firmware type to keep CI minutes (and cost) low. Drops the matrix-generation job. --- .github/workflows/ci.yml | 48 +++++++++++++--------------------------- 1 file changed, 15 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38a8436b0d..5281b3a041 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,37 +36,24 @@ jobs: name: test-results path: .pio/build/native/ - generate-matrix: - name: Generate Build Matrix - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set.outputs.matrix }} - steps: - - name: Clone Repo - uses: actions/checkout@v6 - - - name: Setup Build Environment - uses: ./.github/actions/setup-build-environment - - - name: Generate Matrix - id: set - run: | - python3 - <<'EOF' >> "$GITHUB_OUTPUT" - import json, subprocess - data = json.loads(subprocess.check_output(["pio", "project", "config", "--json-output"])) - envs = sorted(s[4:] for s, _ in data if s.startswith("env:") and s != "env:native") - size = 4 - chunks = [" ".join(envs[i:i + size]) for i in range(0, len(envs), size)] - print("matrix=" + json.dumps({"chunk": chunks})) - EOF - build: name: Build - needs: generate-matrix runs-on: ubuntu-latest strategy: fail-fast: false - matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }} + matrix: + environment: + - Heltec_v3_companion_radio_ble + - Heltec_v3_repeater + - Heltec_v3_room_server + - RAK_4631_companion_radio_ble + - RAK_4631_repeater + - RAK_4631_room_server + - PicoW_repeater + - wio-e5-mini_repeater + - LilyGo_Tlora_C6_repeater_ + - wio_wm1110_repeater + - Tbeam_SX1276_repeater steps: - name: Clone Repo uses: actions/checkout@v6 @@ -74,10 +61,5 @@ jobs: - name: Setup Build Environment uses: ./.github/actions/setup-build-environment - - name: Build Environments - run: | - for env in ${{ matrix.chunk }}; do - echo "::group::$env" - pio run -e "$env" - echo "::endgroup::" - done + - name: Build ${{ matrix.environment }} + run: pio run -e ${{ matrix.environment }} From 3cde399f2668900c73955b0627eddbb4a1266560 Mon Sep 17 00:00:00 2001 From: Alessio D'Ambrosio Date: Tue, 16 Jun 2026 20:50:38 +0200 Subject: [PATCH 3/3] ci: 2 boards per firmware type from different manufacturers Cover each firmware type (companion ble/usb, repeater, room server) with two boards from different manufacturers, spread across the ESP32-S3, ESP32 SX1276, nRF52, LR1110, RP2040, STM32 and ESP32-C6 platforms. --- .github/workflows/ci.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5281b3a041..c1dbfa2901 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,16 +44,13 @@ jobs: matrix: environment: - Heltec_v3_companion_radio_ble - - Heltec_v3_repeater - - Heltec_v3_room_server - RAK_4631_companion_radio_ble - - RAK_4631_repeater - - RAK_4631_room_server - - PicoW_repeater + - LilyGo_T3S3_sx1276_companion_radio_usb + - Xiao_rp2040_companion_radio_usb - wio-e5-mini_repeater - LilyGo_Tlora_C6_repeater_ - - wio_wm1110_repeater - - Tbeam_SX1276_repeater + - wio_wm1110_room_server + - Tbeam_SX1262_room_server steps: - name: Clone Repo uses: actions/checkout@v6