Skip to content

Commit

Permalink
Add workflow to build firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyparrish committed Jun 15, 2024
1 parent b8de060 commit 862e4cb
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 1 deletion.
48 changes: 48 additions & 0 deletions .github/workflows/build-firmware.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build Firmware

on:
push: # Trigger for pushes.
paths:
- hardware/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 and test."
required: false

# 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: ${{ github.workflow }}-${{ 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
uses: arduino/setup-arduino-cli@v1

- 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: arduino-cli lib install Ethernet

- name: Build firmware
run: |
cd hardware/firmware
make build
2 changes: 1 addition & 1 deletion .github/workflows/build-hardware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push: # Trigger for pushes.
paths:
- hardware/**
- !hardware/firmware/**
- '!hardware/firmware/**'
- .github/workflows/build-hardware.yaml
pull_request: # Trigger for pull requests.
types: [opened, synchronize, reopened, ready_for_review]
Expand Down

0 comments on commit 862e4cb

Please sign in to comment.