Skip to content

Commit dd82eec

Browse files
committed
Add "smoke test" examples compilation CI workflow
On every push or pull request that affects library source or example files, and periodically, compile all example sketches for the specified boards.
1 parent b255b98 commit dd82eec

File tree

2 files changed

+83
-0
lines changed

2 files changed

+83
-0
lines changed
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Compile Examples
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
paths:
7+
- ".github/workflows/compile-examples.yml"
8+
- "examples/**"
9+
- "src/**"
10+
pull_request:
11+
paths:
12+
- ".github/workflows/compile-examples.yml"
13+
- "examples/**"
14+
- "src/**"
15+
schedule:
16+
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
17+
- cron: "0 8 * * TUE"
18+
workflow_dispatch:
19+
repository_dispatch:
20+
21+
jobs:
22+
build:
23+
name: ${{ matrix.board.fqbn }}
24+
runs-on: ubuntu-latest
25+
26+
strategy:
27+
fail-fast: false
28+
29+
matrix:
30+
board:
31+
- fqbn: arduino:avr:leonardo
32+
platforms: |
33+
- name: arduino:avr
34+
tone: true
35+
- fqbn: arduino:sam:arduino_due_x_dbg
36+
platforms: |
37+
- name: arduino:sam
38+
# Bug report: https://github.com/arduino/ArduinoCore-sam/issues/24
39+
# Change the value to true once it is fixed.
40+
tone: false
41+
- fqbn: arduino:samd:mkrzero
42+
platforms: |
43+
- name: arduino:samd
44+
tone: true
45+
- fqbn: arduino:samd:nano_33_iot
46+
platforms: |
47+
- name: arduino:samd
48+
tone: true
49+
50+
# Make board type-specific customizations to the matrix jobs
51+
include:
52+
- board:
53+
tone: true
54+
sketch-paths: |
55+
- examples/MIDIUSB_buzzer
56+
- board:
57+
tone: false
58+
sketch-paths: ""
59+
60+
steps:
61+
- name: Checkout repository
62+
uses: actions/checkout@v2
63+
64+
- name: Compile examples
65+
uses: arduino/compile-sketches@v1
66+
with:
67+
github-token: ${{ secrets.GITHUB_TOKEN }}
68+
fqbn: ${{ matrix.board.fqbn }}
69+
platforms: ${{ matrix.board.platforms }}
70+
libraries: |
71+
# Install the library from the local path.
72+
- source-path: ./
73+
# Additional library dependencies can be listed here.
74+
# See: https://github.com/arduino/compile-sketches#libraries
75+
sketch-paths: |
76+
# Examples to compile for all boards
77+
- examples/MIDIUSB_clock
78+
- examples/MIDIUSB_loop
79+
- examples/MIDIUSB_read
80+
- examples/MIDIUSB_read
81+
# Board-specific examples
82+
${{ matrix.sketch-paths }}

README.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
= {repository-name} Library for Arduino =
55

66
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml/badge.svg["Check Arduino status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/check-arduino.yml"]
7+
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml/badge.svg["Compile Examples status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/compile-examples.yml"]
78
image:https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml/badge.svg["Spell Check status", link="https://github.com/{repository-owner}/{repository-name}/actions/workflows/spell-check.yml"]
89

910
This library allows an Arduino board with USB capabilities to act as a MIDI instrument over USB. The library is based on PluggableUSB, so is only compatible with Arduino IDE 1.6.6 and newer.

0 commit comments

Comments
 (0)