diff --git a/.github/actions/setup-pio/action.yml b/.github/actions/setup-pio/action.yml new file mode 100644 index 000000000..932a060c8 --- /dev/null +++ b/.github/actions/setup-pio/action.yml @@ -0,0 +1,34 @@ +name: Setup PlatformIO +description: 'Installs PlatformIO and necessary dependencies.' + +inputs: + python-version: + description: 'Set Python version (optional)' + required: false + default: '3.9' + +runs: + using: "composite" + steps: + - name: Cache pip + id: cache-pip + uses: actions/cache@v3 + with: + path: | + ~/.cache/pip + ~/.platformio/.cache + key: ${{ runner.os }}-${{ inputs.python-version }}-pio + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ inputs.python-version }} + + - name: Install PlatformIO Core + shell: bash + run: pip install --upgrade platformio + + - name: Install intelhex + shell: bash + run: pip install --upgrade intelhex + diff --git a/.github/path-filters.yml b/.github/path-filters.yml new file mode 100644 index 000000000..ca0dfcf31 --- /dev/null +++ b/.github/path-filters.yml @@ -0,0 +1,19 @@ +arm-tag_common: &arm-tag_common + - 'ARM_Tag_FW/common/**' + +arm-tag_88MZ100: + - '*arm-tag_common' + - 'ARM_Tag_FW/88MZ100/**' + +arm-tag_newton-m3-nrf52811: + - '*arm-tag_common' + - 'ARM_Tag_FW/Newton_M3_nRF52811/**' + +arm-tag_nrf-bootloader: + - 'ARM_Tag_FW/nRF_Bootloader/**' + +arm-tag_nrf52811-pio-ap: + - 'ARM_Tag_FW/nrf52811_Platformio_AP/**' + +esp32-ap: + - 'ESP32_AP-Flasher/**' diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml deleted file mode 100644 index 407825ec6..000000000 --- a/.github/workflows/build-test.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Firmware build test - -on: [push,pull_request] - -jobs: - build: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - - uses: actions/cache@v3 - with: - path: | - ~/.cache/pip - ~/.platformio/.cache - key: ${{ runner.os }}-pio - - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - name: Install PlatformIO Core - run: pip install --upgrade platformio - - - name: Install intelhex - run: pip install --upgrade intelhex - -# - name: Build Simple_AP -# run: | -# cd ESP32_AP-Flasher -# pio run --environment Simple_AP -# pio run --target buildfs --environment Simple_AP - - - name: Build OpenEPaperLink_Mini_AP - run: | - cd ESP32_AP-Flasher - pio run --environment OpenEPaperLink_Mini_AP - pio run --target buildfs --environment OpenEPaperLink_Mini_AP - - - name: Build OpenEPaperLink_AP_and_Flasher - run: | - cd ESP32_AP-Flasher - pio run --environment OpenEPaperLink_AP_and_Flasher - pio run --target buildfs --environment OpenEPaperLink_AP_and_Flasher - - - name: Build ESP32_S3_16_8_YELLOW_AP - run: | - cd ESP32_AP-Flasher - pio run --environment ESP32_S3_16_8_YELLOW_AP - pio run --target buildfs --environment ESP32_S3_16_8_YELLOW_AP - - - name: OpenEPaperLink_Mini_AP_v4 - run: | - cd ESP32_AP-Flasher - pio run --environment OpenEPaperLink_Mini_AP_v4 - pio run --target buildfs --environment OpenEPaperLink_Mini_AP_v4 diff --git a/.github/workflows/conditional-build-test.yml b/.github/workflows/conditional-build-test.yml new file mode 100644 index 000000000..aa47f108a --- /dev/null +++ b/.github/workflows/conditional-build-test.yml @@ -0,0 +1,85 @@ +name: FW Build / Test (Conditional Job PoC) + +on: [push, pull_request] + +jobs: + determine-builds: + name: Evaluate Required Builds + runs-on: ubuntu-20.04 + timeout-minutes: 1 + # Map a step output to job output + outputs: + arm-tag_newton-m3-nrf52811: ${{ steps.filter.outputs.arm-tag_newton-m3-nrf52811 }} + arm-tag_nrf-bootloader: ${{ steps.filter.outputs.arm-tag_nrf-bootloader }} + arm-tag_nrf52811-pio-ap: ${{ steps.filter.outputs.arm-tag_nrf52811-pio-ap }} + arm-tag_88MZ100: ${{ steps.filter.outputs.arm-tag_88MZ100 }} + esp32-ap: ${{ steps.filter.outputs.esp32-ap }} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v3 + id: filter + with: + # TODO: work around issue with paths-filter (https://github.com/dorny/paths-filter/issues/227) + token: '' + filters: .github/path-filters.yml + + tag-build: + name: Build Tag FW + needs: [determine-builds] + runs-on: ubuntu-22.04 + steps: + - name: Checkout Code (with submodules) + uses: actions/checkout@v4 + with: + submodules: 'recursive' + - uses: ./.github/actions/setup-pio + + - name: ARM_Tag_FW/nRF_Bootloader + if: ${{ needs.determine-builds.outputs.arm-tag_nrf-bootloader == 'true' }} + run: | + cd ARM_Tag_FW/nRF_Bootloader + pio run --environment nRFBootload + + - name: ARM_Tag_FW/Newton_M3_nRF52811 + if: ${{ needs.determine-builds.outputs.arm-tag_newton-m3-nrf52811 == 'true' }} + run: | + pio --version + cd ARM_Tag_FW/Newton_M3_nRF52811 + pio run --environment Newton_M3_Universal + + - name: ARM_Tag_FW/nrf52811_Platformio_AP + if: ${{ needs.determine-builds.outputs.arm-tag_nrf52811-pio-ap == 'true' }} + run: | + cd ARM_Tag_FW/nrf52811_Platformio_AP + pio run --environment nrf52811_OEPL_AP + + - name: ARM_Tag_FW/88MZ100_OpenEpaperLink_7.4 + if: ${{ needs.determine-builds.outputs.arm-tag_88MZ100 == 'true' }} + # TODO: Implement build for 88MZ100 + run: | + echo "Note: build for 88MZ100 has not been implementted yet." + + ap-build: + name: Build AP FW + needs: [determine-builds] + if: ${{ needs.determine-builds.outputs.esp32-ap == 'true' }} + strategy: + matrix: + environment: + - OpenEPaperLink_Mini_AP + - OpenEPaperLink_AP_and_Flasher + - ESP32_S3_16_8_YELLOW_AP + - OpenEPaperLink_Mini_AP_v4 + runs-on: ubuntu-22.04 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - uses: ./.github/actions/setup-pio + + - name: Build ${{ matrix.environment }} + run: | + cd ESP32_AP-Flasher + pio run --environment ${{ matrix.environment }} + pio run --target buildfs --environment ${{ matrix.environment }} + +