Skip to content

Commit

Permalink
Add automatic build workflows (#11)
Browse files Browse the repository at this point in the history
Self explanatory. No more manual building of files for me!

(Also fuck Arduino's Compile Sketches for not fucking working.)
  • Loading branch information
SeongGino authored Jun 26, 2024
1 parent 5a11ebd commit 1b89ef7
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/arduino-cli-builds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: OpenFIRE Builds
on:
push:
pull_request:

jobs:
arduino-build:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: Raspberry Pi Pico
fqbn: rpipico
flags: freq=133,usbstack=tinyusb,opt=Optimize3

- name: Raspberry Pi Pico W (USB)
fqbn: rpipicow
flags: freq=133,usbstack=tinyusb,opt=Optimize3

- name: Raspberry Pi Pico W (Bluetooth)
fqbn: rpipicow
flags: freq=133,usbstack=tinyusb,opt=Optimize3,ipbtstack=ipv4btcble,wificountry=worldwide

- name: Adafruit ItsyBitsy RP2040
fqbn: adafruit_itsybitsy
flags: freq=133,usbstack=tinyusb,opt=Optimize3

- name: Adafruit KB2040
fqbn: adafruit_kb2040
flags: freq=133,usbstack=tinyusb,opt=Optimize3

- name: Arduino Nano RP2040 Connect
fqbn: arduino_nano_connect
flags: freq=133,usbstack=tinyusb,opt=Optimize3

- name: VCC-GND YD RP2040
fqbn: vccgnd_yd_rp2040
flags: freq=133,usbstack=tinyusb,opt=Optimize3

- name: Waveshare RP2040 Zero
fqbn: waveshare_rp2040_zero
flags: freq=133,usbstack=tinyusb,opt=Optimize3

- name: Generic RP2040
fqbn: generic
flags: freq=133,usbstack=tinyusb,opt=Optimize3

steps:
- name: Checkout OpenFIRE-Firmware
uses: actions/checkout@v4
with:
submodules: true

- name: Install Arduino-cli
uses: arduino/setup-arduino-cli@v1

# arduino nano uses this just to access LEDs, grr...
- name: Install Arduino Nano Connect library
if: ${{ matrix.fqbn == 'arduino_nano_connect' }}
run: arduino-cli lib install WiFiNINA

- name: Setting up Arduino-cli
run: arduino-cli core install rp2040:rp2040 --additional-urls https://github.com/SeongGino/arduino-pico/releases/download/3.9.2-fix/package_rp2040_fix_index_orig.json

- name: Compile for ${{ matrix.name }}
run: arduino-cli compile -e --fqbn rp2040:rp2040:${{matrix.fqbn}}:${{matrix.flags}} SamcoEnhanced --libraries libraries

- name: Rename build file
run: cp ${{github.workspace}}/SamcoEnhanced/build/rp2040.rp2040.${{matrix.fqbn}}/SamcoEnhanced.ino.uf2 OpenFIREfw.${{ matrix.fqbn }}.uf2

# TODO: when USB + Bluetooth is fixed, we won't need the Pico W method
- name: Upload artifact (Non-Pico W)
if: ${{ matrix.fqbn != 'rpipicow' }}
uses: actions/[email protected]
with:
path: OpenFIREfw.${{ matrix.fqbn }}.uf2
name: OpenFIREfw - ${{ matrix.name }}
if-no-files-found: error

- name: Upload artifact (Pico W)
if: ${{ matrix.fqbn == 'rpipicow' }}
uses: actions/[email protected]
with:
path: OpenFIREfw.${{ matrix.fqbn }}.uf2
name: OpenFIREfw - ${{ matrix.name }}
if-no-files-found: error

0 comments on commit 1b89ef7

Please sign in to comment.