Skip to content

add monster eyes and CI workflow #16

add monster eyes and CI workflow

add monster eyes and CI workflow #16

Workflow file for this run

name: build
on:
push:
pull_request:
workflow_dispatch:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
env:
PUBLISH: ${{ github.event_name == 'release' ||
github.event_name == 'workflow_dispatch' }}
strategy:
fail-fast: false
matrix:
include:
# ---- RP2040 / RP2350 ----------------------------------------------
- name: feather-rp2040-dvi
fqbn: rp2040:rp2040:adafruit_feather_dvi:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_DVI -DNUM_EYES=1"
- name: feather-rp2040-st7789-1eye
fqbn: rp2040:rp2040:adafruit_feather:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=1"
- name: feather-rp2040-st7789-1eye
fqbn: rp2040:rp2040:adafruit_feather:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=1"
- name: feather-rp2040-st7789-2eye
fqbn: rp2040:rp2040:adafruit_feather:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=2"
- name: feather-rp2040-gc9a01a-1eye
fqbn: rp2040:rp2040:adafruit_feather:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=1"
- name: feather-rp2040-gc9a01a-2eye
fqbn: rp2040:rp2040:adafruit_feather:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=2"
- name: feather-rp2350-gc9a01a-1eye
fqbn: rp2040:rp2040:adafruit_feather_rp2350_hstx:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=1"
- name: feather-rp2350-st7789-1eye
fqbn: rp2040:rp2040:adafruit_feather_rp2350_hstx:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=1"
- name: feather-rp2350-gc9a01a-2eye
fqbn: rp2040:rp2040:adafruit_feather_rp2350_hstx:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=2"
- name: feather-rp2350-st7789-2eye
fqbn: rp2040:rp2040:adafruit_feather_rp2350_hstx:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=2"
- name: qtpy-rp2040-gc9a01a-1eye
fqbn: rp2040:rp2040:adafruit_qtpy:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=1"
# ---- ESP32-S2/S3 ----------------------------------------------
- name: metro-esp32s3-st7789-1eye
fqbn: esp32:esp32:adafruit_metro_esp32s3:PartitionScheme=tinyuf2,USBMode=default
core: esp32
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=1"
- name: metro-esp32s3-gc9a01a-1eye
fqbn: esp32:esp32:adafruit_metro_esp32s3:PartitionScheme=tinyuf2,USBMode=default
core: esp32
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=1"
- name: metro-esp32s3-st7789-2eye
fqbn: esp32:esp32:adafruit_metro_esp32s3:PartitionScheme=tinyuf2,USBMode=default
core: esp32
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=2"
- name: metro-esp32s3-gc9a01a-2eye
fqbn: esp32:esp32:adafruit_metro_esp32s3:PartitionScheme=tinyuf2,USBMode=default
core: esp32
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=2"
- name: qtpy-esp32s2-gc9a01a-1eye
fqbn: esp32:esp32:adafruit_qtpy_esp32s2:PartitionScheme=tinyuf2
core: esp32
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=1"
name: ${{ matrix.name }}
steps:
- uses: actions/checkout@v4
- uses: arduino/setup-arduino-cli@v2
- name: Add board manager URLs
run: |
arduino-cli config init
arduino-cli config add board_manager.additional_urls \
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
arduino-cli config add board_manager.additional_urls \
https://espressif.github.io/arduino-esp32/package_esp32_index.json
arduino-cli core update-index
- name: Install core
run: arduino-cli core install ${{ matrix.core }}:${{ matrix.core }}
- name: Install libraries
run: |
arduino-cli lib install \
"Adafruit GFX Library" \
"Adafruit BusIO" \
"Adafruit ST7735 and ST7789 Library" \
"Adafruit GC9A01A" \
"Adafruit ILI9341" \
"ArduinoJson" \
"SdFat - Adafruit Fork" \
"Adafruit SPIFlash"
if [ "${{ matrix.core }}" = "esp32" ]; then
arduino-cli lib install "Adafruit TinyUSB Library"
fi
# PicoDVI is the Adafruit fork and is not in the library index.
if [ "${{ matrix.core }}" = "rp2040" ]; then
git clone --depth 1 https://github.com/adafruit/PicoDVI.git \
"$HOME/Arduino/libraries/PicoDVI"
fi
- name: Locate the sketch
id: sketch
run: |
INO=$(find . -name '*.ino' -not -path './build/*' | head -n 1)
if [ -z "$INO" ]; then
echo "No .ino found in the checkout." >&2
exit 1
fi
DIR=$(dirname "$INO")
echo "dir=$DIR" >> "$GITHUB_OUTPUT"
echo "Sketch: $INO (directory $DIR)"
- name: Compile
run: |
arduino-cli compile \
--fqbn "${{ matrix.fqbn }}" \
--build-property "compiler.cpp.extra_flags=${{ matrix.defines }}" \
--output-dir "build/${{ matrix.name }}" \
--warnings default \
"${{ steps.sketch.outputs.dir }}"
- name: Collect the binary
if: env.PUBLISH == 'true'
run: |
SRC="build/${{ matrix.name }}"
BASE="Adafruit_Monster_Eyes-${{ matrix.name }}"
mkdir -p dist
if ls "$SRC"/*.uf2 >/dev/null 2>&1; then
cp "$SRC"/*.uf2 "dist/$BASE.uf2" # RP2040 / RP2350
elif ls "$SRC"/*.merged.bin >/dev/null 2>&1; then
cp "$SRC"/*.merged.bin "dist/$BASE.bin" # ESP32, flash at 0x0
elif ls "$SRC"/*.ino.bin >/dev/null 2>&1; then
cp "$SRC"/*.ino.bin "dist/$BASE.bin" # ESP32 fallback
else
echo "No .uf2 or .bin produced in $SRC" >&2
ls -la "$SRC" >&2
exit 1
fi
ls -l dist
- uses: actions/upload-artifact@v4
if: env.PUBLISH == 'true'
with:
name: ${{ matrix.name }}
path: dist/*
if-no-files-found: error
- name: Attach to the release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: dist/*
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: adafruit/ci-arduino
path: ci
- name: pre-install
run: bash ci/actions_install.sh
- name: clang
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
- name: doxygen
env:
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
PRETTYNAME: "Adafruit Monster Eyes"
run: bash ci/doxy_gen_and_deploy.sh Adafruit_Monster_Eyes