Skip to content

Commit 88b60fb

Browse files
authored
Merge pull request #1 from adafruit/all_eyes
add monster eyes and CI workflow
2 parents a17e147 + f13f117 commit 88b60fb

15 files changed

Lines changed: 3882 additions & 1494 deletions

.github/workflows/build.yml

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
name: build
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
env:
16+
PUBLISH: ${{ github.event_name == 'release' ||
17+
github.event_name == 'workflow_dispatch' }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
# ---- RP2040 / RP2350 ----------------------------------------------
23+
- name: feather-rp2040-dvi
24+
fqbn: rp2040:rp2040:adafruit_feather_dvi:flash=8388608_0,usbstack=tinyusb
25+
core: rp2040
26+
defines: "-DEYE_PANEL=EYE_PANEL_DVI -DNUM_EYES=1"
27+
28+
- name: feather-rp2040-st7789-1eye
29+
fqbn: rp2040:rp2040:adafruit_feather:flash=8388608_0,usbstack=tinyusb
30+
core: rp2040
31+
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=1"
32+
33+
- name: feather-rp2040-st7789-1eye
34+
fqbn: rp2040:rp2040:adafruit_feather:flash=8388608_0,usbstack=tinyusb
35+
core: rp2040
36+
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=1"
37+
38+
- name: feather-rp2040-st7789-2eye
39+
fqbn: rp2040:rp2040:adafruit_feather:flash=8388608_0,usbstack=tinyusb
40+
core: rp2040
41+
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=2"
42+
43+
- name: feather-rp2040-gc9a01a-1eye
44+
fqbn: rp2040:rp2040:adafruit_feather:flash=8388608_0,usbstack=tinyusb
45+
core: rp2040
46+
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=1"
47+
48+
- name: feather-rp2040-gc9a01a-2eye
49+
fqbn: rp2040:rp2040:adafruit_feather:flash=8388608_0,usbstack=tinyusb
50+
core: rp2040
51+
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=2"
52+
53+
- name: feather-rp2350-gc9a01a-1eye
54+
fqbn: rp2040:rp2040:adafruit_feather_rp2350_hstx:flash=8388608_0,usbstack=tinyusb
55+
core: rp2040
56+
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=1"
57+
58+
- name: feather-rp2350-st7789-1eye
59+
fqbn: rp2040:rp2040:adafruit_feather_rp2350_hstx:flash=8388608_0,usbstack=tinyusb
60+
core: rp2040
61+
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=1"
62+
63+
- name: feather-rp2350-gc9a01a-2eye
64+
fqbn: rp2040:rp2040:adafruit_feather_rp2350_hstx:flash=8388608_0,usbstack=tinyusb
65+
core: rp2040
66+
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=2"
67+
68+
- name: feather-rp2350-st7789-2eye
69+
fqbn: rp2040:rp2040:adafruit_feather_rp2350_hstx:flash=8388608_0,usbstack=tinyusb
70+
core: rp2040
71+
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=2"
72+
73+
- name: qtpy-rp2040-gc9a01a-1eye
74+
fqbn: rp2040:rp2040:adafruit_qtpy:flash=8388608_0,usbstack=tinyusb
75+
core: rp2040
76+
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=1"
77+
# ---- ESP32-S2/S3 ----------------------------------------------
78+
- name: metro-esp32s3-st7789-1eye
79+
fqbn: esp32:esp32:adafruit_metro_esp32s3:PartitionScheme=tinyuf2,USBMode=default
80+
core: esp32
81+
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=1"
82+
83+
- name: metro-esp32s3-gc9a01a-1eye
84+
fqbn: esp32:esp32:adafruit_metro_esp32s3:PartitionScheme=tinyuf2,USBMode=default
85+
core: esp32
86+
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=1"
87+
88+
- name: metro-esp32s3-st7789-2eye
89+
fqbn: esp32:esp32:adafruit_metro_esp32s3:PartitionScheme=tinyuf2,USBMode=default
90+
core: esp32
91+
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=2"
92+
93+
- name: metro-esp32s3-gc9a01a-2eye
94+
fqbn: esp32:esp32:adafruit_metro_esp32s3:PartitionScheme=tinyuf2,USBMode=default
95+
core: esp32
96+
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=2"
97+
98+
- name: qtpy-esp32s2-gc9a01a-1eye
99+
fqbn: esp32:esp32:adafruit_qtpy_esp32s2:PartitionScheme=tinyuf2
100+
core: esp32
101+
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=1"
102+
103+
name: ${{ matrix.name }}
104+
steps:
105+
- uses: actions/checkout@v4
106+
107+
- uses: arduino/setup-arduino-cli@v2
108+
109+
- name: Add board manager URLs
110+
run: |
111+
arduino-cli config init
112+
arduino-cli config add board_manager.additional_urls \
113+
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
114+
arduino-cli config add board_manager.additional_urls \
115+
https://espressif.github.io/arduino-esp32/package_esp32_index.json
116+
arduino-cli core update-index
117+
118+
- name: Install core
119+
run: arduino-cli core install ${{ matrix.core }}:${{ matrix.core }}
120+
121+
- name: Install libraries
122+
run: |
123+
arduino-cli lib install \
124+
"Adafruit GFX Library" \
125+
"Adafruit BusIO" \
126+
"Adafruit ST7735 and ST7789 Library" \
127+
"Adafruit GC9A01A" \
128+
"Adafruit ILI9341" \
129+
"ArduinoJson" \
130+
"SdFat - Adafruit Fork" \
131+
"Adafruit SPIFlash"
132+
if [ "${{ matrix.core }}" = "esp32" ]; then
133+
arduino-cli lib install "Adafruit TinyUSB Library"
134+
fi
135+
# PicoDVI is the Adafruit fork and is not in the library index.
136+
if [ "${{ matrix.core }}" = "rp2040" ]; then
137+
git clone --depth 1 https://github.com/adafruit/PicoDVI.git \
138+
"$HOME/Arduino/libraries/PicoDVI"
139+
fi
140+
141+
- name: Locate the sketch
142+
id: sketch
143+
run: |
144+
INO=$(find . -name '*.ino' -not -path './build/*' | head -n 1)
145+
if [ -z "$INO" ]; then
146+
echo "No .ino found in the checkout." >&2
147+
exit 1
148+
fi
149+
DIR=$(dirname "$INO")
150+
echo "dir=$DIR" >> "$GITHUB_OUTPUT"
151+
echo "Sketch: $INO (directory $DIR)"
152+
153+
- name: Compile
154+
run: |
155+
arduino-cli compile \
156+
--fqbn "${{ matrix.fqbn }}" \
157+
--build-property "compiler.cpp.extra_flags=${{ matrix.defines }}" \
158+
--output-dir "build/${{ matrix.name }}" \
159+
--warnings default \
160+
"${{ steps.sketch.outputs.dir }}"
161+
162+
- name: Collect the binary
163+
if: env.PUBLISH == 'true'
164+
run: |
165+
SRC="build/${{ matrix.name }}"
166+
BASE="Adafruit_Monster_Eyes-${{ matrix.name }}"
167+
mkdir -p dist
168+
if ls "$SRC"/*.uf2 >/dev/null 2>&1; then
169+
cp "$SRC"/*.uf2 "dist/$BASE.uf2" # RP2040 / RP2350
170+
elif ls "$SRC"/*.merged.bin >/dev/null 2>&1; then
171+
cp "$SRC"/*.merged.bin "dist/$BASE.bin" # ESP32, flash at 0x0
172+
elif ls "$SRC"/*.ino.bin >/dev/null 2>&1; then
173+
cp "$SRC"/*.ino.bin "dist/$BASE.bin" # ESP32 fallback
174+
else
175+
echo "No .uf2 or .bin produced in $SRC" >&2
176+
ls -la "$SRC" >&2
177+
exit 1
178+
fi
179+
ls -l dist
180+
181+
- uses: actions/upload-artifact@v4
182+
if: env.PUBLISH == 'true'
183+
with:
184+
name: ${{ matrix.name }}
185+
path: dist/*
186+
if-no-files-found: error
187+
- name: Attach to the release
188+
if: github.event_name == 'release'
189+
uses: softprops/action-gh-release@v2
190+
with:
191+
files: dist/*
192+
193+
docs:
194+
runs-on: ubuntu-latest
195+
steps:
196+
- uses: actions/setup-python@v5
197+
with:
198+
python-version: "3.x"
199+
- uses: actions/checkout@v4
200+
- uses: actions/checkout@v4
201+
with:
202+
repository: adafruit/ci-arduino
203+
path: ci
204+
- name: pre-install
205+
run: bash ci/actions_install.sh
206+
- name: clang
207+
run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r .
208+
- name: doxygen
209+
env:
210+
GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }}
211+
PRETTYNAME: "Adafruit Monster Eyes"
212+
run: bash ci/doxy_gen_and_deploy.sh Adafruit_Monster_Eyes

0 commit comments

Comments
 (0)