Skip to content

Commit 426d1c6

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 95c833e commit 426d1c6

File tree

2 files changed

+52
-16
lines changed

2 files changed

+52
-16
lines changed

.github/workflows/compile-examples.yml

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,55 @@
11
name: Compile Examples
2-
on: [push, pull_request]
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+
321
jobs:
4-
build:
5-
runs-on: ubuntu-latest
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:megaavr:uno2018
32+
platforms: |
33+
- name: arduino:megaavr
34+
- fqbn: arduino:samd:nano_33_iot
35+
platforms: |
36+
- name: arduino:samd
37+
38+
steps:
39+
- name: Checkout repository
40+
uses: actions/checkout@v2
641

7-
strategy:
8-
matrix:
9-
fqbn: [
10-
"arduino:megaavr:uno2018:mode=on",
11-
"arduino:samd:nano_33_iot"
12-
]
42+
- name: Compile examples
43+
uses: arduino/compile-sketches@v1
44+
with:
45+
github-token: ${{ secrets.GITHUB_TOKEN }}
46+
fqbn: ${{ matrix.board.fqbn }}
47+
platforms: ${{ matrix.board.platforms }}
48+
libraries: |
49+
# Install the library from the local path.
50+
- source-path: ./
51+
# Additional library dependencies can be listed here.
52+
# See: https://github.com/arduino/compile-sketches#libraries
53+
sketch-paths: |
54+
- examples
1355
14-
steps:
15-
- uses: actions/checkout@v1
16-
with:
17-
fetch-depth: 1
18-
- uses: arduino/actions/libraries/compile-examples@master
19-
with:
20-
fqbn: ${{ matrix.fqbn }}

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
Allows you to read the accelerometer and gyroscope values from the LSM6DS3 IMU on your Arduino Nano 33 IoT or Arduino Uno WiFi Rev2 boards.

0 commit comments

Comments
 (0)