Merge pull request #906 from t-huyeng/build-workflow

Build workflow - run for all boards
This commit is contained in:
Verkehrsrot 2022-11-01 21:24:24 +01:00 committed by GitHub
commit b6320f0cc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 79 additions and 23 deletions

View File

@ -4,24 +4,60 @@ on:
pull_request: pull_request:
push: push:
branches: branches:
- master - master
- build-workflow
workflow_dispatch:
jobs: jobs:
build: build:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest] os: [ubuntu-latest]
# os: [ubuntu-latest, windows-latest, macos-latest]
include: include:
- os: ubuntu-latest - os: ubuntu-latest
path: ~/.cache/pip path: ~/.cache/pip
platformio-path: ~/.platformio platformio-path: ~/.platformio
- os: macos-latest # - os: macos-latest
path: ~/Library/Caches/pip # path: ~/Library/Caches/pip
platformio-path: ~/Library/Caches/platformio # platformio-path: ~/Library/Caches/platformio
- os: windows-latest # - os: windows-latest
path: ~\AppData\Local\pip\Cache # path: ~\AppData\Local\pip\Cache
platformio-path: ~\AppData\Local\platformio\Cache # platformio-path: ~\AppData\Local\platformio\Cache
board:
[
generic.h,
ebox.h,
eboxtube.h,
ecopower.h,
heltec.h,
heltecv2.h,
heltecv21.h,
ttgov1.h,
ttgov2.h,
ttgov21old.h,
ttgov21new.h,
ttgofox.h,
ttgobeam.h,
ttgobeam10.h,
ttgotdisplay.h,
ttgotwristband.h,
fipy.h,
lopy.h,
lopy4.h,
lolin32litelora.h,
lolin32lora.h,
lolin32lite.h,
wemos32oled.h,
wemos32matrix.h,
octopus32.h,
tinypico.h,
tinypicomatrix.h,
m5core.h,
m5fire.h,
olimexpoeiso.h,
]
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
@ -52,5 +88,9 @@ jobs:
cp src/loraconf_sample.h src/loraconf.h cp src/loraconf_sample.h src/loraconf.h
cp src/ota_sample.conf src/ota.conf cp src/ota_sample.conf src/ota.conf
cp src/paxcounter_orig.conf src/paxcounter.conf cp src/paxcounter_orig.conf src/paxcounter.conf
- name: Run PlatformIO - name: Clean
run: pio run run: pio run -t clean -e ci
- name: Run PlatformIO CI for ${{ matrix.board }}
env:
CI_HALFILE: ${{ matrix.board }}
run: pio run -e ci

View File

@ -27,7 +27,16 @@ haldir = os.path.join (srcdir, "hal")
# check if hal file is present in source directory # check if hal file is present in source directory
halconfig = config.get("board", "halfile") halconfig = config.get("board", "halfile")
# check if hal file is set by ENV CI_HALFILE
if os.getenv("CI_HALFILE"):
# if set, use ENV CI_HALFILE
print("CI_HALFILE ENV FOUND")
# override halconfig
halconfig = os.getenv("CI_HALFILE")
halconfigfile = os.path.join (haldir, halconfig) halconfigfile = os.path.join (haldir, halconfig)
if os.path.isfile(halconfigfile) and os.access(halconfigfile, os.R_OK): if os.path.isfile(halconfigfile) and os.access(halconfigfile, os.R_OK):
print("Parsing hardware configuration from " + halconfigfile) print("Parsing hardware configuration from " + halconfigfile)
else: else:

View File

@ -94,7 +94,6 @@ lib_deps_all =
${common.lib_deps_sensors} ${common.lib_deps_sensors}
${common.lib_deps_ledmatrix} ${common.lib_deps_ledmatrix}
build_flags_basic = build_flags_basic =
-include "src/hal/${board.halfile}"
-include "src/paxcounter.conf" -include "src/paxcounter.conf"
'-DCORE_DEBUG_LEVEL=${common.debug_level}' '-DCORE_DEBUG_LEVEL=${common.debug_level}'
'-DLOG_LOCAL_LEVEL=${common.debug_level}' '-DLOG_LOCAL_LEVEL=${common.debug_level}'
@ -115,7 +114,9 @@ upload_speed = ${common.upload_speed}
;upload_port = COM12 ;upload_port = COM12
platform = ${common.platform_espressif32} platform = ${common.platform_espressif32}
lib_deps = ${common.lib_deps_all} lib_deps = ${common.lib_deps_all}
build_flags = ${common.build_flags_all} build_flags =
-include "src/hal/${board.halfile}"
${common.build_flags_all}
upload_protocol = ${common.upload_protocol} upload_protocol = ${common.upload_protocol}
extra_scripts = ${common.extra_scripts} extra_scripts = ${common.extra_scripts}
monitor_speed = ${common.monitor_speed} monitor_speed = ${common.monitor_speed}
@ -131,3 +132,9 @@ upload_protocol = esptool
upload_protocol = esptool upload_protocol = esptool
platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream
platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git
[env:ci]
build_flags =
-include "src/hal/${sysenv.CI_HALFILE}" ; set by CI
${common.build_flags_all}
upload_protocol = esptool