mirror of
https://github.com/OpenEPaperLink/OpenEPaperLink.git
synced 2026-03-21 01:04:30 +01:00
Conditional build / test pipeline (#287)
* POC: Conditional Build Jobs / Steps Demonstrate a built/test pipeline which make use of both conditional jobs and steps. * use paths-filter fallback (no token) * fix typo in cache key * remove test file * add in nRF_Bootloader to confitional build
This commit is contained in:
34
.github/actions/setup-pio/action.yml
vendored
Normal file
34
.github/actions/setup-pio/action.yml
vendored
Normal file
@@ -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
|
||||
|
||||
19
.github/path-filters.yml
vendored
Normal file
19
.github/path-filters.yml
vendored
Normal file
@@ -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/**'
|
||||
54
.github/workflows/build-test.yml
vendored
54
.github/workflows/build-test.yml
vendored
@@ -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
|
||||
85
.github/workflows/conditional-build-test.yml
vendored
Normal file
85
.github/workflows/conditional-build-test.yml
vendored
Normal file
@@ -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 }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user