Skip to content

Commit c9f1739

Browse files
committed
ci: add build & test workflow
Runs on push to main / PRs / manual dispatch. Builds and tests the Swift package (macOS + Xcode 26) and compiles the Buddy firmware via arduino-cli, since the existing DMG workflow is manual-only and covers neither tests nor the firmware.
1 parent 1dd4dea commit c9f1739

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
swift-build-test:
14+
name: Swift build & test
15+
runs-on: macos-15
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Select Xcode 26
21+
run: |
22+
XCODE_APP="$(find /Applications -maxdepth 1 -name 'Xcode_26*.app' -type d | sort | tail -n 1)"
23+
if [ -z "$XCODE_APP" ]; then
24+
echo "Xcode 26 is required (SwiftUI #Preview macros need its toolchain plugin)"
25+
exit 1
26+
fi
27+
sudo xcode-select -s "$XCODE_APP/Contents/Developer"
28+
29+
- name: Show toolchain
30+
run: swift --version
31+
32+
- name: Build
33+
run: swift build
34+
35+
- name: Test
36+
run: swift test
37+
38+
firmware-compile:
39+
name: Buddy firmware compile
40+
runs-on: ubuntu-latest
41+
steps:
42+
- name: Checkout
43+
uses: actions/checkout@v4
44+
45+
- name: Setup arduino-cli
46+
uses: arduino/setup-arduino-cli@v2
47+
48+
- name: Install ESP32 core
49+
run: |
50+
arduino-cli config init
51+
arduino-cli config add board_manager.additional_urls https://espressif.github.io/arduino-esp32/package_esp32_index.json
52+
arduino-cli core update-index
53+
arduino-cli core install esp32:esp32
54+
55+
- name: Install libraries
56+
run: |
57+
arduino-cli lib install \
58+
"Adafruit GFX Library" \
59+
"Adafruit ST7735 and ST7789 Library" \
60+
"Adafruit BusIO"
61+
62+
- name: Compile firmware
63+
run: arduino-cli compile --fqbn esp32:esp32:esp32c6:CDCOnBoot=cdc,PartitionScheme=huge_app hardware

0 commit comments

Comments
 (0)