Skip to content

[DO NOT MERGE] Add Github Actions workflow with official arduino-cli action to build library examples #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/build-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build Library Examples
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
fqbn: [
"arduino:samd:mkrwifi1010",
"arduino:samd:nano_33_iot",
"arduino:megaavr:uno2018:mode=on",
"arduino:mbed:nano33ble"
]

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Setup arduino-cli
uses: arduino/actions/setup-arduino-cli@master

- name: Export FQBN and BOARD
run: |
FQBN=${{ matrix.fqbn }}
CORE=`echo "$FQBN" | cut -d':' -f1,2`
echo ::set-env name=FQBN::"$FQBN"
echo ::set-env name=CORE::"$CORE"

- name: Install Core
run: |
set -x
arduino-cli core update-index
arduino-cli core install $CORE

- name: Symlink Library
run: |
set -x
mkdir -p $HOME/Arduino/libraries
ln -s $PWD $HOME/Arduino/libraries/.

- name: Compile Examples
run: |
set -x
EXAMPLES=`find examples/ -name '*.ino' | xargs dirname | uniq`
for EXAMPLE in $EXAMPLES; do
echo Building example $EXAMPLE
arduino-cli compile --verbose --warnings all --fqbn $FQBN $EXAMPLE
done || exit 1