-
Notifications
You must be signed in to change notification settings - Fork 0
262 lines (234 loc) · 9.01 KB
/
Copy pathbuild.yml
File metadata and controls
262 lines (234 loc) · 9.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
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
bundle: 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
bundle: feather_rp2040
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
bundle: feather_rp2040
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-2eye
bundle: feather_rp2040
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-2eye
bundle: feather_rp2350
fqbn: rp2040:rp2040:adafruit_feather_rp2350_hstx:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=2"
- name: metro-rp2350-gc9a01a-2eye
bundle: metro_rp2350
fqbn: rp2040:rp2040:adafruit_metro_rp2350:flash=16777216_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=2"
- name: metro-rp2350-st7789-2eye
bundle: metro_rp2350
fqbn: rp2040:rp2040:adafruit_metro_rp2350:flash=16777216_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_ST7789 -DNUM_EYES=2"
- name: qtpy-rp2040-gc9a01a-1eye
bundle: qtpy_rp2040
fqbn: rp2040:rp2040:adafruit_qtpy:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: "-DEYE_PANEL=EYE_PANEL_GC9A01A -DNUM_EYES=1"
# ---- Dual PicoDVI, synced over a UART ------------------
- name: dual-dvi-feather-primary
bundle: dual_picodvi
asset: primary
fqbn: rp2040:rp2040:adafruit_feather_dvi:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: >-
-DEYE_PANEL=EYE_PANEL_DVI -DNUM_EYES=1
-DEYE_SYNC=EYE_SYNC_PRIMARY
- name: dual-dvi-feather-secondary
bundle: dual_picodvi
asset: secondary
fqbn: rp2040:rp2040:adafruit_feather_dvi:flash=8388608_0,usbstack=tinyusb
core: rp2040
defines: >-
-DEYE_PANEL=EYE_PANEL_DVI -DNUM_EYES=1
-DEYE_SYNC=EYE_SYNC_SECONDARY
# ---- ESP32 --------------------------------------------------------
- name: metro-esp32s3-st7789-2eye
bundle: metro_esp32s3
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
bundle: metro_esp32s3
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
bundle: qtpy_esp32s2
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="${{ matrix.asset || 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.bundle }}__${{ matrix.name }}
path: dist/*
if-no-files-found: error
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
# Builds are grouped into one zip per board, so a release lists a handful of
# named archives
bundle:
needs: build
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
path: incoming
- name: Group by board and zip
run: |
set -e
# Each artifact arrives as incoming/<bundle>__<name>/<file>.
for d in incoming/*/; do
a=$(basename "$d")
case "$a" in
*__*) grp="${a%%__*}" ;;
*) echo "Skipping unexpected artifact $a" >&2; continue ;;
esac
mkdir -p "stage/$grp"
cp "$d"* "stage/$grp/"
done
mkdir -p out
for g in stage/*/; do
g=$(basename "$g")
(cd stage && zip -r "../out/$g.zip" "$g")
done
echo "== assembled =="
for z in out/*.zip; do
echo "--- $z"
unzip -l "$z" | sed -n '4,30p'
done
- uses: actions/upload-artifact@v4
with:
name: firmware
path: out/*.zip
if-no-files-found: error
- name: Attach to the release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v2
with:
files: out/*.zip