diff --git a/.github/workflows/arduino.yml b/.github/workflows/arduino.yml new file mode 100644 index 0000000..f053559 --- /dev/null +++ b/.github/workflows/arduino.yml @@ -0,0 +1,61 @@ +name: Puara-Module Arduino Example CI +on: [push, pull_request] +jobs: + lint: # Step 1 : Check if repository comformity to Arduino Library standards + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: arduino/arduino-lint-action@v2 + with: + project-type: library + compliance: strict + library-manager: submit + + compile: # Step 2: Compile Examples for Multiple Boards + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Arduino CLI + run: | + curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh + export PATH="/home/runner/work/puara-module/puara-module/bin:$PATH" + echo "/home/runner/work/puara-module/puara-module/bin" >> $GITHUB_PATH + arduino-cli version + arduino-cli config init + arduino-cli core update-index + + # Install Board Cores + - name: Install ESP32 Core + run: | + arduino-cli core install esp32:esp32 + + # Install Library Dependencies + - name: Install Library Dependencies + run: | + arduino-cli lib list + mkdir -p $HOME/Arduino/libraries + ln -s $PWD $HOME/Arduino/libraries/puara + arduino-cli lib list + + # Compile Example Sketches for Tinypico + - name: Compile for TinyPICO + run: | + arduino-cli compile --fqbn esp32:esp32:um_tinypico --build-property build.partitions=min_spiffs --build-property upload.maximum_size=1966080 examples/puara_basic_template/puara_basic_template.ino + + # Compile Example Sketches for Xiao ESP32-S3 + - name: Compile for XIAO ESP32-S3 + run: | + arduino-cli compile --fqbn esp32:esp32:XIAO_ESP32S3 --build-property build.partitions=min_spiffs --build-property upload.maximum_size=1966080 examples/puara_basic_template/puara_basic_template.ino + + # Compile Example Sketches for + - name: Compile for M5StickC + run: | + arduino-cli compile --fqbn esp32:esp32:m5stack_stickc --build-property build.partitions=min_spiffs --build-property upload.maximum_size=1966080 examples/puara_basic_template/puara_basic_template.ino + + # Compile Example Sketches for Xiao ESP32-S3 + - name: Compile for ESP32C3 Dev Module + run: | + arduino-cli compile --fqbn esp32:esp32:esp32c3 --build-property build.partitions=min_spiffs --build-property upload.maximum_size=1966080 examples/puara_basic_template/puara_basic_template.ino + + # to see all available boards, run the following command in a terminal : $ arduino-cli board listall esp32:esp32 + \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..67a6bc5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,102 @@ +name: Build +on: [push, pull_request] + +jobs: + build: + name: ${{ matrix.template.name }}-${{ matrix.template.fs }}-${{ matrix.environment.name }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + # we have 6 pio templates, which we want to build for 4 different boards + # we have two filesystems we want to test on boards that support them + template: + - name: basic + fs: littlefs + - name: basic + fs: spiffs + - name: basic-gestures + fs: littlefs + - name: basic-gestures + fs: spiffs + - name: basic-osc + fs: littlefs + - name: basic-osc + fs: spiffs + - name: button-osc + fs: littlefs + - name: button-osc + fs: spiffs + - name: libmapper-osc + fs: littlefs + - name: libmapper-osc + fs: spiffs + - name: ble-advertising + fs: littlefs + - name: ble-advertising + fs: spiffs + environment: + - name: xiao_esp32s3 + board: seeed_xiao_esp32s3 + extra_flags: "-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue" + - name: tinypico + board: tinypico + extra_flags: "-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue" + - name: m5stick-c + board: m5stick-c + extra_flags: "-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue" + - name: ESP32-C3 + board: esp32-c3-devkitc-02 + extra_flags: "-DBOARD_HAS_PSRAM" + + steps: + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 + with: + repository: Puara/puara-module-templates + path: templates + ref: main + + - uses: actions/cache@v4 + with: + path: | + ~/.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: Create Template Folders and add board ID for each template + run: | + cd templates + cp -r ${{ matrix.template.name }} ./${{ matrix.template.name }}-${{ matrix.template.fs }} + + # Add board ID to wokwi.toml file + echo "[board]" >> .//${{ matrix.template.name }}-${{ matrix.template.fs }}/wokwi.toml + echo "id = \"${{ matrix.environment.board }}\"" >> .//${{ matrix.template.name }}-${{ matrix.template.fs }}/wokwi.toml + + # The boards and templates each have different requirements, so the platformio.ini file is different for each. + # The platformio.ini files that are in each template may select only one board to be built -- so here we generate + # a temporary platformio.ini file for each template/board combination to ensure the pipeline tests them all. + - name: Generate Temporary platformio.ini + run: | + export PUARA_MODULE_PATH="symlink://$PWD/" + cd templates + bash scripts/generate-platformio.ini.sh \ + ${{ matrix.template.name }}-${{ matrix.template.fs }} \ + ${{ matrix.environment.board }} \ + "${{ matrix.environment.extra_flags }}" + + # Build using the temporary platformio.ini file + - name: Build + run: | + cd templates + cd ./${{ matrix.template.name }}-${{ matrix.template.fs }} + pio settings set force_verbose 1 + pio run --environment template --project-conf platformioTemp.ini diff --git a/library.properties b/library.properties index 4f7fc0a..2343ce5 100644 --- a/library.properties +++ b/library.properties @@ -1,9 +1,9 @@ -name=puara module +name=puara-module version=1.0.0 -author=Edu +author=Edu_Meneses maintainer=Edu , SAT sentence=esp32 DMI helpers paragraph=This library provides helper modules for ESP32-based music controllers using the Puara framework. It includes a Wi-Fi manager for easy network setup, an OSC manager for Open Sound Control messaging, and compatibility with libmapper for device mapping. Designed to simplify development of digital musical instruments and controllers. -category=Uncategorized +category=Device Control url=https://github.com/Puara/puara-module architectures=* diff --git a/src/puara-module.h b/src/puara-module.h new file mode 100644 index 0000000..b95f574 --- /dev/null +++ b/src/puara-module.h @@ -0,0 +1,4 @@ +#pragma once +#include + +// This header satisfies arduino library lint LS008