From 1c2de7c6123b575dc7951f03ad8cb28a72e6d1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Tue, 26 Nov 2024 16:56:14 -0500 Subject: [PATCH 1/9] build: allow ble module to build with refactored puara-module --- ble-advertising/platformio.ini | 9 +++++++-- ble-advertising/src/main.cpp | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ble-advertising/platformio.ini b/ble-advertising/platformio.ini index 8a6dc3f..39fe1d1 100644 --- a/ble-advertising/platformio.ini +++ b/ble-advertising/platformio.ini @@ -14,12 +14,14 @@ description = Puara module manager [common] lib_deps = https://github.com/Puara/puara-gestures.git - https://github.com/Puara/puara-module.git#0.3 + https://github.com/Puara/puara-module.git arduino-libraries/ArduinoBLE johboh/nlohmann-json@^3.11.3 build_flags = -DCONFIG_ARDUINO_LOOP_STACK_SIZE=32768 - + -std=gnu++2a +build_unflags = + -std=gnu++11 -std=gnu++14 -std=gnu++17 [env:tinypico] platform = espressif32 board = tinypico @@ -29,6 +31,7 @@ build_flags = -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 monitor_echo = yes @@ -42,6 +45,7 @@ board = m5stick-c framework = arduino board_build.partitions = min_spiffs_no_OTA.csv build_flags = ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 monitor_echo = yes @@ -55,6 +59,7 @@ board = adafruit_feather_esp32s3 framework = arduino board_build.partitions = min_spiffs_no_OTA.csv build_flags = ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 monitor_echo = yes diff --git a/ble-advertising/src/main.cpp b/ble-advertising/src/main.cpp index 9b8ded3..cdf5934 100644 --- a/ble-advertising/src/main.cpp +++ b/ble-advertising/src/main.cpp @@ -19,6 +19,8 @@ unsigned int firmware_version = 20220906; // descriptors' functions #include "puara_gestures.h" +#include + // Initialize Puara's module manager Puara puara; From 9f6d612634a74f4ecc3436f9347427d44bc06a36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Tue, 26 Nov 2024 17:02:59 -0500 Subject: [PATCH 2/9] build: fix build for the other modules --- basic-osc/platformio.ini | 14 +++++++++++++- basic-osc/src/main.cpp | 2 ++ basic/platformio.ini | 14 +++++++++++++- basic/src/main.cpp | 2 ++ libmapper-osc/platformio.ini | 8 +++++++- 5 files changed, 37 insertions(+), 3 deletions(-) diff --git a/basic-osc/platformio.ini b/basic-osc/platformio.ini index 0de0c63..bd2adb0 100644 --- a/basic-osc/platformio.ini +++ b/basic-osc/platformio.ini @@ -13,8 +13,12 @@ description = Puara module manager [common] lib_deps = - https://github.com/Puara/puara-module.git#0.3 + https://github.com/Puara/puara-module.git https://github.com/cnmat/OSC#3.5.8 +build_flags = + -std=gnu++2a +build_unflags = + -std=gnu++11 -std=gnu++14 -std=gnu++17 [env:Xiao] platform = espressif32 @@ -23,6 +27,8 @@ framework = arduino board_build.partitions = min_spiffs_no_OTA.csv lib_deps = ${common.lib_deps} +build_flags = ${common.build_flags} +build_unflags = ${common.build_unflags} monitor_speed = 115200 monitor_echo = yes monitor_filters = @@ -37,6 +43,8 @@ board_build.partitions = min_spiffs_no_OTA.csv build_flags = -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue + ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 @@ -53,6 +61,8 @@ board_build.partitions = min_spiffs_no_OTA.csv build_flags = -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue + ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 @@ -69,6 +79,8 @@ board_build.partitions = min_spiffs_no_OTA.csv build_flags = -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue + ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 diff --git a/basic-osc/src/main.cpp b/basic-osc/src/main.cpp index ea55faf..0cb46f3 100644 --- a/basic-osc/src/main.cpp +++ b/basic-osc/src/main.cpp @@ -10,6 +10,8 @@ // If using Arduino.h, include it before including puara.h #include "puara.h" +#include + // Initialize Puara's module manager Puara puara; diff --git a/basic/platformio.ini b/basic/platformio.ini index 9436785..1d3939d 100644 --- a/basic/platformio.ini +++ b/basic/platformio.ini @@ -13,7 +13,11 @@ description = Puara module manager [common] lib_deps = - https://github.com/Puara/puara-module.git#0.3 + https://github.com/Puara/puara-module.git +build_flags = + -std=gnu++2a +build_unflags = + -std=gnu++11 -std=gnu++14 -std=gnu++17 [env:Xiao] platform = espressif32 @@ -21,6 +25,8 @@ board = seeed_xiao_esp32c3 framework = arduino board_build.partitions = min_spiffs_no_OTA.csv lib_deps = ${common.lib_deps} +build_flags = ${common.build_flags} +build_unflags = ${common.build_unflags} monitor_speed = 115200 monitor_echo = yes monitor_filters = @@ -35,6 +41,8 @@ board_build.partitions = min_spiffs_no_OTA.csv build_flags = -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue + ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 monitor_echo = yes @@ -50,6 +58,8 @@ board_build.partitions = min_spiffs_no_OTA.csv build_flags = -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue + ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 monitor_echo = yes @@ -65,6 +75,8 @@ board_build.partitions = min_spiffs_no_OTA.csv build_flags = -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue + ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 monitor_echo = yes diff --git a/basic/src/main.cpp b/basic/src/main.cpp index 2b869f2..604f450 100644 --- a/basic/src/main.cpp +++ b/basic/src/main.cpp @@ -10,6 +10,8 @@ // If using Arduino.h, include it before including puara.h #include "puara.h" +#include + // Initialize Puara's module manager Puara puara; diff --git a/libmapper-osc/platformio.ini b/libmapper-osc/platformio.ini index 0620ce8..3ab9f9e 100644 --- a/libmapper-osc/platformio.ini +++ b/libmapper-osc/platformio.ini @@ -15,9 +15,12 @@ description = Puara module manager lib_deps = https://github.com/Puara/puara-gestures.git https://github.com/mathiasbredholt/libmapper-arduino.git#v0.3 - https://github.com/Puara/puara-module.git#0.3 + https://github.com/Puara/puara-module.git build_flags = -DCONFIG_ARDUINO_LOOP_STACK_SIZE=32768 + -std=gnu++2a +build_unflags = + -std=gnu++11 -std=gnu++14 -std=gnu++17 [env:Xiao] platform = espressif32 @@ -41,6 +44,7 @@ build_flags = -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 monitor_echo = yes @@ -54,6 +58,7 @@ board = m5stick-c framework = arduino board_build.partitions = min_spiffs_no_OTA.csv build_flags = ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 monitor_echo = yes @@ -67,6 +72,7 @@ board = esp32-c3-devkitc-02 framework = arduino board_build.partitions = min_spiffs_no_OTA.csv build_flags = ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 monitor_echo = yes From 7255fbdec5377551d4558b0f89854b84003087ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Wed, 27 Nov 2024 12:34:32 -0500 Subject: [PATCH 3/9] build: fix an invalid flag --- basic-osc/platformio.ini | 1 - 1 file changed, 1 deletion(-) diff --git a/basic-osc/platformio.ini b/basic-osc/platformio.ini index bd2adb0..c8a29c2 100644 --- a/basic-osc/platformio.ini +++ b/basic-osc/platformio.ini @@ -78,7 +78,6 @@ framework = arduino board_build.partitions = min_spiffs_no_OTA.csv build_flags = -DBOARD_HAS_PSRAM - -mfix-esp32-psram-cache-issue ${common.build_flags} build_unflags = ${common.build_unflags} lib_deps = From 07e28943b1b2a5776a62c705cb236db7f09cc479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Wed, 27 Nov 2024 13:46:35 -0500 Subject: [PATCH 4/9] ci: use a matrix to handle all templates and envs --- .github/workflows/build.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0999c4c..21e9def 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,8 +3,15 @@ on: [push,pull_request] jobs: build: + name: ${{ matrix.template }} ${{ matrix.environment }} runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + template: [ basic, basic-osc, ble-advertising, libmapper-osc ] + environment: [ Xiao, tinypico, m5stick-c, ESP32-S3 ] + steps: - uses: actions/checkout@v4 - uses: actions/cache@v4 @@ -13,30 +20,21 @@ jobs: ~/.cache/pip ~/.platformio/.cache key: ${{ runner.os }}-pio + - uses: actions/setup-python@v5 with: python-version: '3.11' + - name: Install PlatformIO Core run: pip install --upgrade platformio - - name: Build ble-advertising - run: cd ./ble-advertising && pio run --environment ESP32-S3 - + - name: Build + run: cd ./${{ matrix.template }} && pio run --environment ${{ matrix.environment }} + - name: Simulate and test ble-advertising with Wokwi uses: wokwi/wokwi-ci-action@v1 with: token: ${{ secrets.WOKWI_CLI_TOKEN }} - path: ./ble-advertising/ # directory with wokwi.toml, relative to repo's root + path: ./${{ matrix.template }}/ # directory with wokwi.toml, relative to repo's root timeout: 30000 expect_text: 'Puara Start Done!' - - - name: Build libmapper-osc - run: cd ./libmapper-osc && pio run --environment ESP32-S3 - - - name: Simulate and test libmapper-osc with Wokwi - uses: wokwi/wokwi-ci-action@v1 - with: - token: ${{ secrets.WOKWI_CLI_TOKEN }} - path: ./libmapper-osc/ # directory with wokwi.toml, relative to repo's root - timeout: 30000 - expect_text: 'Puara Start Done!' \ No newline at end of file From 681400179a426c67509ed7d54905365071654a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Wed, 27 Nov 2024 13:51:24 -0500 Subject: [PATCH 5/9] ci: disable wokwi temporarily --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 21e9def..f4a8c9e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,10 +31,10 @@ jobs: - name: Build run: cd ./${{ matrix.template }} && pio run --environment ${{ matrix.environment }} - - name: Simulate and test ble-advertising with Wokwi - uses: wokwi/wokwi-ci-action@v1 - with: - token: ${{ secrets.WOKWI_CLI_TOKEN }} - path: ./${{ matrix.template }}/ # directory with wokwi.toml, relative to repo's root - timeout: 30000 - expect_text: 'Puara Start Done!' +# - name: Simulate and test ble-advertising with Wokwi +# uses: wokwi/wokwi-ci-action@v1 +# with: +# token: ${{ secrets.WOKWI_CLI_TOKEN }} +# path: ./${{ matrix.template }}/ # directory with wokwi.toml, relative to repo's root +# timeout: 30000 +# expect_text: 'Puara Start Done!' From 55af8cc98146461389a9b287187baefca707020b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Wed, 27 Nov 2024 13:54:25 -0500 Subject: [PATCH 6/9] ci: build fixes --- basic/platformio.ini | 1 - libmapper-osc/src/main.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/basic/platformio.ini b/basic/platformio.ini index 1d3939d..7002e92 100644 --- a/basic/platformio.ini +++ b/basic/platformio.ini @@ -74,7 +74,6 @@ framework = arduino board_build.partitions = min_spiffs_no_OTA.csv build_flags = -DBOARD_HAS_PSRAM - -mfix-esp32-psram-cache-issue ${common.build_flags} build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} diff --git a/libmapper-osc/src/main.cpp b/libmapper-osc/src/main.cpp index 6164212..678f683 100644 --- a/libmapper-osc/src/main.cpp +++ b/libmapper-osc/src/main.cpp @@ -12,6 +12,7 @@ unsigned int firmware_version = 20220906; // Include Puara's module manager // If using Arduino.h, include it before including puara.h #include "puara.h" +#include // Include Puara's high-level descriptor library if planning to use the high-level // descriptors' functions From cde3dc924d0d8a80df57f000410dc13895843fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Wed, 27 Nov 2024 14:01:04 -0500 Subject: [PATCH 7/9] ci: try to add xiao to ble template and fix libmapper xiao template --- ble-advertising/platformio.ini | 14 ++++++++++++++ libmapper-osc/platformio.ini | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/ble-advertising/platformio.ini b/ble-advertising/platformio.ini index 39fe1d1..9571490 100644 --- a/ble-advertising/platformio.ini +++ b/ble-advertising/platformio.ini @@ -22,6 +22,20 @@ build_flags = -std=gnu++2a build_unflags = -std=gnu++11 -std=gnu++14 -std=gnu++17 + +[env:Xiao] +platform = espressif32 +board = seeed_xiao_esp32c3 +framework = arduino +board_build.partitions = min_spiffs_no_OTA.csv +build_flags = ${common.build_flags} +lib_deps = ${common.lib_deps} +monitor_speed = 115200 +monitor_echo = yes +monitor_filters = + default + esp32_exception_decoder + [env:tinypico] platform = espressif32 board = tinypico diff --git a/libmapper-osc/platformio.ini b/libmapper-osc/platformio.ini index 3ab9f9e..b3a090f 100644 --- a/libmapper-osc/platformio.ini +++ b/libmapper-osc/platformio.ini @@ -20,7 +20,12 @@ build_flags = -DCONFIG_ARDUINO_LOOP_STACK_SIZE=32768 -std=gnu++2a build_unflags = - -std=gnu++11 -std=gnu++14 -std=gnu++17 + -std=c++11 + -std=c++14 + -std=c++17 + -std=gnu++11 + -std=gnu++14 + -std=gnu++17 [env:Xiao] platform = espressif32 From b65b6d1223d5aba1cda8d6a243afbfea1e85d152 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Wed, 27 Nov 2024 14:08:48 -0500 Subject: [PATCH 8/9] ci: make build verbose to try to understand failure --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4a8c9e..00bd589 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,10 @@ jobs: run: pip install --upgrade platformio - name: Build - run: cd ./${{ matrix.template }} && pio run --environment ${{ matrix.environment }} + run: | + cd ./${{ matrix.template }} + pio settings set force_verbose 1 + pio run --environment ${{ matrix.environment }} # - name: Simulate and test ble-advertising with Wokwi # uses: wokwi/wokwi-ci-action@v1 From c57856678a9557812c2ee51627674e0d5163640c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Wed, 27 Nov 2024 14:14:24 -0500 Subject: [PATCH 9/9] ci: add missing build_unflags --- ble-advertising/platformio.ini | 1 + libmapper-osc/platformio.ini | 1 + 2 files changed, 2 insertions(+) diff --git a/ble-advertising/platformio.ini b/ble-advertising/platformio.ini index 9571490..cb282d4 100644 --- a/ble-advertising/platformio.ini +++ b/ble-advertising/platformio.ini @@ -29,6 +29,7 @@ board = seeed_xiao_esp32c3 framework = arduino board_build.partitions = min_spiffs_no_OTA.csv build_flags = ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 monitor_echo = yes diff --git a/libmapper-osc/platformio.ini b/libmapper-osc/platformio.ini index b3a090f..3da4912 100644 --- a/libmapper-osc/platformio.ini +++ b/libmapper-osc/platformio.ini @@ -33,6 +33,7 @@ board = seeed_xiao_esp32c3 framework = arduino board_build.partitions = min_spiffs_no_OTA.csv build_flags = ${common.build_flags} +build_unflags = ${common.build_unflags} lib_deps = ${common.lib_deps} monitor_speed = 115200 monitor_echo = yes