ci: add build & test workflow #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| swift-build-test: | |
| name: Swift build & test | |
| runs-on: macos-15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Select Xcode 26 | |
| run: | | |
| XCODE_APP="$(find /Applications -maxdepth 1 -name 'Xcode_26*.app' -type d | sort | tail -n 1)" | |
| if [ -z "$XCODE_APP" ]; then | |
| echo "Xcode 26 is required (SwiftUI #Preview macros need its toolchain plugin)" | |
| exit 1 | |
| fi | |
| sudo xcode-select -s "$XCODE_APP/Contents/Developer" | |
| - name: Show toolchain | |
| run: swift --version | |
| - name: Build | |
| run: swift build | |
| - name: Test | |
| run: swift test | |
| firmware-compile: | |
| name: Buddy firmware compile | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup arduino-cli | |
| uses: arduino/setup-arduino-cli@v2 | |
| - name: Install ESP32 core | |
| run: | | |
| arduino-cli config init | |
| arduino-cli config add board_manager.additional_urls https://espressif.github.io/arduino-esp32/package_esp32_index.json | |
| arduino-cli core update-index | |
| arduino-cli core install esp32:esp32 | |
| - name: Install libraries | |
| run: | | |
| arduino-cli lib install \ | |
| "Adafruit GFX Library" \ | |
| "Adafruit ST7735 and ST7789 Library" \ | |
| "Adafruit BusIO" | |
| - name: Compile firmware | |
| run: arduino-cli compile --fqbn esp32:esp32:esp32c6:CDCOnBoot=cdc,PartitionScheme=huge_app hardware |