Skip to content

Commit 325b018

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 example sketches for the specified boards. Because this library doesn't currently have any example sketches, the Mouse built-in example sketches are used. This is an artifact from a time when the Mouse functionality was part of the core library, rather than a standalone library.
1 parent 87a9880 commit 325b018

File tree

2 files changed

+79
-0
lines changed

2 files changed

+79
-0
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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+
- fqbn: arduino:sam:arduino_due_x_dbg
35+
platforms: |
36+
- name: arduino:sam
37+
- fqbn: arduino:samd:arduino_zero_edbg
38+
platforms: |
39+
- name: arduino:samd
40+
- fqbn: arduino:samd:mkrzero
41+
platforms: |
42+
- name: arduino:samd
43+
- fqbn: arduino:samd:nano_33_iot
44+
platforms: |
45+
- name: arduino:samd
46+
- fqbn: arduino:mbed_portenta:envie_m7
47+
platforms: |
48+
- name: arduino:mbed_portenta
49+
- fqbn: arduino:mbed_nano:nano33ble
50+
platforms: |
51+
- name: arduino:mbed_nano
52+
- fqbn: arduino:mbed_nano:nanorp2040connect
53+
platforms: |
54+
- name: arduino:mbed_nano
55+
56+
steps:
57+
- name: Checkout repository
58+
uses: actions/checkout@v2
59+
60+
- name: Checkout built-in examples
61+
uses: actions/checkout@v2
62+
with:
63+
repository: arduino/arduino-examples
64+
path: ${{ env.BUILT_IN_EXAMPLES_PATH }}
65+
66+
- name: Compile examples
67+
uses: arduino/compile-sketches@v1
68+
with:
69+
github-token: ${{ secrets.GITHUB_TOKEN }}
70+
fqbn: ${{ matrix.board.fqbn }}
71+
platforms: ${{ matrix.board.platforms }}
72+
libraries: |
73+
# Install the library from the local path.
74+
- source-path: ./
75+
# Additional library dependencies can be listed here.
76+
# See: https://github.com/arduino/compile-sketches#libraries
77+
sketch-paths: |
78+
- ${{ env.BUILT_IN_EXAMPLES_PATH }}/examples/09.USB/Mouse

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 Mouse.

0 commit comments

Comments
 (0)