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..c1dbfa2901 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +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/ + + build: + name: Build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + environment: + - Heltec_v3_companion_radio_ble + - RAK_4631_companion_radio_ble + - LilyGo_T3S3_sx1276_companion_radio_usb + - Xiao_rp2040_companion_radio_usb + - wio-e5-mini_repeater + - LilyGo_Tlora_C6_repeater_ + - wio_wm1110_room_server + - Tbeam_SX1262_room_server + 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/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/