Skip to content

Wait for serial before running speed tests #63

Wait for serial before running speed tests

Wait for serial before running speed tests #63

name: Build Firmware
on:
push: # Trigger for pushes.
branches:
- main
paths:
- firmware/**
- .github/workflows/build-firmware.yaml
pull_request: # Trigger for pull requests.
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch: # Allows for manual triggering.
inputs:
ref:
description: "The ref to build."
required: false
workflow_call: # Allows for another workflow to call this one.
inputs:
ref:
description: "The ref to build."
required: true
type: string
for-release:
description: "True if we should upload artifacts for a release."
default: false
type: boolean
# If another instance of this workflow is started for the same PR, cancel the
# old one. If a PR is updated and a new test run is started, the old test run
# will be cancelled automatically to conserve resources.
concurrency:
group: build-firmware-${{ inputs.ref || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Firmware
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.ref }}
- name: Install Arduino CLI
run: |
export BINDIR=~/bin
mkdir -p $BINDIR
# This install script reads BINDIR
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
echo $BINDIR >> $GITHUB_PATH
- name: Install Arduino RP2040 core
run: |
arduino-cli config add board_manager.additional_urls https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
arduino-cli core update-index
arduino-cli core install rp2040:rp2040
- name: Install Arduino libraries
run: |
# Until a new release is out that solves
# https://github.com/arduino-libraries/Ethernet/issues/267,
# we install a forked version with the fix.
arduino-cli config set library.enable_unsafe_install true
arduino-cli lib install --git-url https://github.com/joeyparrish/Ethernet
- name: Build firmware
run: |
cd firmware
make build
- name: Upload firmware
uses: actions/upload-artifact@v4
if: inputs.for-release
with:
name: firmware
path: firmware/firmware.ino.uf2
retention-days: 1