Skip to content

Commit 6370523

Browse files
committed
Add CI workflow to compile example sketches
On every push and pull request, do a "smoke test" by compiling the example sketches of the library for the given list of Arduino boards.
1 parent f72c573 commit 6370523

File tree

2 files changed

+86
-0
lines changed

2 files changed

+86
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Compile Examples
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- ".github/workflows/compile-examples.yml"
7+
- "examples/**"
8+
- "src/**"
9+
push:
10+
paths:
11+
- ".github/workflows/compile-examples.yml"
12+
- "examples/**"
13+
- "src/**"
14+
schedule:
15+
# run every Tuesday at 3 AM UTC to catch breakage caused by changes to external dependencies (libraries, platforms)
16+
- cron: "0 3 * * 2"
17+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch
18+
workflow_dispatch:
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
24+
env:
25+
# Libraries to install for all boards
26+
UNIVERSAL_LIBRARIES: |
27+
# Install the ArduinoModbus library from the local path
28+
- source-path: ./
29+
- name: ArduinoRS485
30+
UNIVERSAL_SKETCH_PATHS: |
31+
- examples/RTU
32+
33+
strategy:
34+
fail-fast: false
35+
36+
matrix:
37+
board:
38+
- fqbn: arduino:avr:nano
39+
nina: false
40+
- fqbn: arduino:avr:leonardo
41+
nina: false
42+
- fqbn: arduino:megaavr:uno2018:mode=off
43+
nina: true
44+
- fqbn: arduino:samd:mkrwifi1010
45+
nina: true
46+
- fqbn: arduino:mbed:nano33ble
47+
nina: false
48+
- fqbn: arduino:mbed:envie_m7
49+
nina: false
50+
51+
# Make board type-specific customizations to the matrix jobs
52+
include:
53+
- board:
54+
# Boards with NINA-W102 module
55+
nina: true
56+
# Install these libraries in addition to the ones defined by env.UNIVERSAL_LIBRARIES
57+
nina-libraries: |
58+
- name: WiFiNINA
59+
# Compile these sketches in addition to the ones defined by env.UNIVERSAL_SKETCH_PATHS
60+
nina-sketch-paths: |
61+
- examples/TCP
62+
- board:
63+
nina: false
64+
nina-libraries: ""
65+
nina-sketch-paths: ""
66+
67+
steps:
68+
- name: Checkout
69+
uses: actions/checkout@v2
70+
71+
- name: Compile examples
72+
uses: arduino/compile-sketches@main
73+
with:
74+
fqbn: ${{ matrix.board.fqbn }}
75+
libraries: |
76+
${{ env.UNIVERSAL_LIBRARIES }}
77+
${{ matrix.nina-libraries }}
78+
sketch-paths: |
79+
${{ env.UNIVERSAL_SKETCH_PATHS }}
80+
${{ matrix.nina-sketch-paths }}

README.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1+
// Define the repository information in these attributes
2+
:repository-owner: arduino-libraries
3+
:repository-name: ArduinoModbus
4+
15
= Modbus Library for Arduino =
26

7+
image:https://github.com/{repository-owner}/{repository-name}/workflows/Compile%20Examples/badge.svg["Compile Examples Status", link="https://github.com/{repository-owner}/{repository-name}/actions?workflow=Compile+Examples"]
8+
39
Use http://www.modbus.org/[Modbus] with your Arduino.
410

511
Using TCP or RS485 shields, like the MKR 485 Shield. This library depends on the ArduinoRS485 library.

0 commit comments

Comments
 (0)