Skip to content

Commit df69cda

Browse files
authored
Merge pull request #44 from per1234/ci
Use GitHub Actions for CI
2 parents f72c573 + ffb45a6 commit df69cda

File tree

12 files changed

+149
-10
lines changed

12 files changed

+149
-10
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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+
SKETCHES_REPORTS_PATH: sketches-reports
26+
# Libraries to install for all boards
27+
UNIVERSAL_LIBRARIES: |
28+
# Install the ArduinoModbus library from the local path
29+
- source-path: ./
30+
- name: ArduinoRS485
31+
UNIVERSAL_SKETCH_PATHS: |
32+
- examples/RTU
33+
34+
strategy:
35+
fail-fast: false
36+
37+
matrix:
38+
board:
39+
- fqbn: arduino:avr:nano
40+
nina: false
41+
- fqbn: arduino:avr:leonardo
42+
nina: false
43+
- fqbn: arduino:megaavr:uno2018:mode=off
44+
nina: true
45+
- fqbn: arduino:samd:mkrwifi1010
46+
nina: true
47+
- fqbn: arduino:mbed:nano33ble
48+
nina: false
49+
- fqbn: arduino:mbed:envie_m7
50+
nina: false
51+
52+
# Make board type-specific customizations to the matrix jobs
53+
include:
54+
- board:
55+
# Boards with NINA-W102 module
56+
nina: true
57+
# Install these libraries in addition to the ones defined by env.UNIVERSAL_LIBRARIES
58+
nina-libraries: |
59+
- name: WiFiNINA
60+
# Compile these sketches in addition to the ones defined by env.UNIVERSAL_SKETCH_PATHS
61+
nina-sketch-paths: |
62+
- examples/TCP
63+
- board:
64+
nina: false
65+
nina-libraries: ""
66+
nina-sketch-paths: ""
67+
68+
steps:
69+
- name: Checkout
70+
uses: actions/checkout@v2
71+
72+
- name: Compile examples
73+
uses: arduino/compile-sketches@main
74+
with:
75+
fqbn: ${{ matrix.board.fqbn }}
76+
libraries: |
77+
${{ env.UNIVERSAL_LIBRARIES }}
78+
${{ matrix.nina-libraries }}
79+
sketch-paths: |
80+
${{ env.UNIVERSAL_SKETCH_PATHS }}
81+
${{ matrix.nina-sketch-paths }}
82+
enable-deltas-report: true
83+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
84+
85+
- name: Save memory usage change report as artifact
86+
uses: actions/upload-artifact@v2
87+
with:
88+
name: ${{ env.SKETCHES_REPORTS_PATH }}
89+
path: ${{ env.SKETCHES_REPORTS_PATH }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Report Size Deltas
2+
3+
on:
4+
schedule:
5+
- cron: "*/5 * * * *"
6+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch
7+
workflow_dispatch:
8+
9+
jobs:
10+
report:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Comment size deltas reports to PRs
15+
uses: arduino/report-size-deltas@main
16+
with:
17+
# The name of the workflow artifact created by the "Compile Examples" workflow
18+
sketches-reports-source: sketches-reports

.github/workflows/spell-check.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Spell Check
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
# run every Tuesday at 3 AM UTC
8+
- cron: "0 3 * * 2"
9+
10+
jobs:
11+
spellcheck:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
18+
# See: https://github.com/codespell-project/actions-codespell/blob/master/README.md
19+
- name: Spell check
20+
uses: codespell-project/actions-codespell@master
21+
with:
22+
check_filenames: true
23+
check_hidden: true
24+
# In the event of a false positive, add the word in all lower case to this file:
25+
ignore_words_file: extras/codespell-ignore-words-list.txt
26+
skip: ./.git,./src/libmodbus

README.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
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+
image:https://github.com/{repository-owner}/{repository-name}/workflows/Spell%20Check/badge.svg["Spell Check Status", link="https://github.com/{repository-owner}/{repository-name}/actions?workflow=Spell+Check"]
9+
310
Use http://www.modbus.org/[Modbus] with your Arduino.
411

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

examples/RTU/ModbusRTUClientKitchenSink/ModbusRTUClientKitchenSink.ino

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Modbus RTU Client Kitchen Sink
33
4-
This sketch creates a Modbus RTU Client and demostrates
4+
This sketch creates a Modbus RTU Client and demonstrates
55
how to use various Modbus Client APIs.
66
77
Circuit:
@@ -164,7 +164,7 @@ void readHoldingRegisterValues() {
164164
void readInputRegisterValues() {
165165
Serial.print("Reading input register values ... ");
166166

167-
// read 10 dsicrete input values from (slave) id 42,
167+
// read 10 discrete input values from (slave) id 42,
168168
if (!ModbusRTUClient.requestFrom(42, INPUT_REGISTERS, 0x00, 10)) {
169169
Serial.print("failed! ");
170170
Serial.println(ModbusRTUClient.lastError());
@@ -181,4 +181,3 @@ void readInputRegisterValues() {
181181
// Alternatively, to read a single Input Register value use:
182182
// ModbusRTUClient.inputRegisterRead(...)
183183
}
184-

examples/RTU/ModbusRTUServerKitchenSink/ModbusRTUServerKitchenSink.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Modbus RTU Server Kitchen Sink
33
4-
This sketch creates a Modbus RTU Server and demostrates
4+
This sketch creates a Modbus RTU Server and demonstrates
55
how to use various Modbus Server APIs.
66
77
Circuit:
@@ -62,7 +62,7 @@ void loop() {
6262
ModbusRTUServer.discreteInputWrite(i, coilValue);
6363
}
6464

65-
// map the holiding register values to the input register values
65+
// map the holding register values to the input register values
6666
for (int i = 0; i < numHoldingRegisters; i++) {
6767
long holdingRegisterValue = ModbusRTUServer.holdingRegisterRead(i);
6868

examples/RTU/ModbusRTUServerLED/ModbusRTUServerLED.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void loop() {
5353
// coil value set, turn LED on
5454
digitalWrite(ledPin, HIGH);
5555
} else {
56-
// coild value clear, turn LED off
56+
// coil value clear, turn LED off
5757
digitalWrite(ledPin, LOW);
5858
}
5959
}

examples/RTU/ModbusRTUTemperatureSensor/ModbusRTUTemperatureSensor.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Modbus RTU Temeperature Sensor
2+
Modbus RTU Temperature Sensor
33
44
This sketch shows you how to interact with a Modbus RTU temperature and humidity sensor.
55
It reads the temperature and humidity values every 5 seconds and outputs them to the

examples/TCP/WiFiModbusClientToggle/WiFiModbusClientToggle.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void setup() {
4040

4141
Serial.println("Modbus TCP Client Toggle");
4242

43-
// attempt to connect to Wifi network:
43+
// attempt to connect to WiFi network:
4444
while (status != WL_CONNECTED) {
4545
Serial.print("Attempting to connect to SSID: ");
4646
Serial.println(ssid);

examples/TCP/WiFiModbusServerLED/WiFiModbusServerLED.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void setup() {
4141

4242
Serial.println("Modbus TCP Server LED");
4343

44-
// attempt to connect to Wifi network:
44+
// attempt to connect to WiFi network:
4545
while (status != WL_CONNECTED) {
4646
Serial.print("Attempting to connect to SSID: ");
4747
Serial.println(ssid);

extras/codespell-ignore-words-list.txt

Whitespace-only changes.

src/ModbusClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ModbusClient {
6565
* @param id (slave) id of target, defaults to 0x00 if not specified
6666
* @param address start address to use for operation
6767
*
68-
* @return holiding register value on success, -1 on failure.
68+
* @return holding register value on success, -1 on failure.
6969
*/
7070
long holdingRegisterRead(int address);
7171
long holdingRegisterRead(int id, int address);

0 commit comments

Comments
 (0)