Skip to content

Commit 9becbec

Browse files
authored
Merge pull request #30 from arduino-libraries/ci
Use GitHub Actions for continuous integration
2 parents e0e8051 + 2ca08db commit 9becbec

40 files changed

+439
-88
lines changed

.codespellrc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# See: https://github.com/codespell-project/codespell#using-a-config-file
2+
[codespell]
3+
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
4+
ignore-words-list = ,
5+
check-filenames =
6+
check-hidden =
7+
skip = ./.git,./extras/D11-Firmware/src,./src/src

.github/dependabot.yml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file
2+
version: 2
3+
4+
updates:
5+
# Configure check for outdated GitHub Actions actions in workflows.
6+
# See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot
7+
- package-ecosystem: github-actions
8+
directory: / # Check the repository's workflows under /.github/workflows/
9+
schedule:
10+
interval: daily

.github/workflows/check-arduino.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check Arduino
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
pull_request:
7+
schedule:
8+
# Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint.
9+
- cron: "0 8 * * TUE"
10+
workflow_dispatch:
11+
repository_dispatch:
12+
13+
jobs:
14+
lint:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
21+
- name: Arduino Lint
22+
uses: arduino/arduino-lint-action@v1
23+
with:
24+
compliance: specification
25+
library-manager: update
26+
# Always use this setting for official repositories. Remove for 3rd party projects.
27+
official: true
28+
project-type: library
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Compile Bootloader
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-bootloader.yml"
8+
- "extras/D11-Bootloader/**"
9+
pull_request:
10+
paths:
11+
- ".github/workflows/compile-bootloader.yml"
12+
- "extras/D11-Bootloader/**"
13+
schedule:
14+
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
15+
- cron: "0 8 * * TUE"
16+
workflow_dispatch:
17+
repository_dispatch:
18+
19+
jobs:
20+
build:
21+
name: ${{ matrix.board.fqbn }}
22+
runs-on: ubuntu-latest
23+
24+
env:
25+
SKETCHES_REPORTS_PATH: sketches-reports
26+
27+
strategy:
28+
fail-fast: false
29+
30+
matrix:
31+
board:
32+
- fqbn: arduino:samd:mkrmotorshield:bootloader=0kb,pinmap=complete,lto=disabled
33+
platforms: |
34+
# Install MattairTech_Arduino:samd via Boards Manager for the toolchain
35+
- name: MattairTech_Arduino:samd
36+
source-url: https://www.mattairtech.com/software/arduino/package_MattairTech_index.json
37+
# This needs to match with the version of MattairTech_Arduino:samd the Arduino fork is based on in order to get the right tool versions
38+
version: 1.6.16
39+
# Install the platform with Motor Carrier support
40+
- name: arduino:samd
41+
source-url: https://github.com/arduino/ArduinoCore-samd.git
42+
version: mkrmotorcarrier
43+
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v2
47+
48+
- name: Compile bootloader
49+
uses: arduino/compile-sketches@v1
50+
with:
51+
github-token: ${{ secrets.GITHUB_TOKEN }}
52+
fqbn: ${{ matrix.board.fqbn }}
53+
platforms: ${{ matrix.board.platforms }}
54+
libraries: |
55+
- name: Sodaq_wdt
56+
sketch-paths: |
57+
- extras/D11-Bootloader
58+
enable-deltas-report: true
59+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
60+
61+
- name: Save sketches report as workflow artifact
62+
uses: actions/upload-artifact@v2
63+
with:
64+
if-no-files-found: error
65+
path: ${{ env.SKETCHES_REPORTS_PATH }}
66+
name: ${{ env.SKETCHES_REPORTS_PATH }}
+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
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+
env:
27+
SKETCHES_REPORTS_PATH: sketches-reports
28+
29+
strategy:
30+
fail-fast: false
31+
32+
matrix:
33+
board:
34+
- fqbn: arduino:samd:nano_33_iot
35+
platforms: |
36+
- name: arduino:samd
37+
type: nano
38+
- fqbn: arduino:samd:mkr1000
39+
platforms: |
40+
- name: arduino:samd
41+
type: mkr
42+
- fqbn: arduino:samd:mkrzero
43+
platforms: |
44+
- name: arduino:samd
45+
type: mkr
46+
- fqbn: arduino:samd:mkrwifi1010
47+
platforms: |
48+
- name: arduino:samd
49+
type: mkr
50+
- fqbn: arduino:samd:mkrfox1200
51+
platforms: |
52+
- name: arduino:samd
53+
type: mkr
54+
- fqbn: arduino:samd:mkrwan1300
55+
platforms: |
56+
- name: arduino:samd
57+
type: mkr
58+
- fqbn: arduino:samd:mkrwan1310
59+
platforms: |
60+
- name: arduino:samd
61+
type: mkr
62+
- fqbn: arduino:samd:mkrgsm1400
63+
platforms: |
64+
- name: arduino:samd
65+
type: mkr
66+
- fqbn: arduino:samd:mkrnb1500
67+
platforms: |
68+
- name: arduino:samd
69+
type: mkr
70+
- fqbn: arduino:samd:mkrvidor4000
71+
platforms: |
72+
- name: arduino:samd
73+
type: mkr
74+
- fqbn: arduino:mbed_portenta:envie_m4
75+
platforms: |
76+
- name: arduino:mbed_portenta
77+
type: mkr
78+
- fqbn: arduino:mbed_portenta:envie_m7
79+
platforms: |
80+
- name: arduino:mbed_portenta
81+
type: mkr
82+
83+
# make board type-specific customizations to the matrix jobs
84+
include:
85+
- board:
86+
type: nano
87+
libraries: |
88+
- name: BNO055
89+
- name: Arduino_BQ24195
90+
sketch-paths: |
91+
- examples/Nano
92+
- board:
93+
type: mkr
94+
libraries: |
95+
-
96+
sketch-paths: |
97+
- examples/Motor_test
98+
- examples/Motor_test_encoder
99+
- examples/Servo_test
100+
101+
steps:
102+
- name: Checkout repository
103+
uses: actions/checkout@v2
104+
105+
- name: Compile examples
106+
uses: arduino/compile-sketches@v1
107+
with:
108+
github-token: ${{ secrets.GITHUB_TOKEN }}
109+
fqbn: ${{ matrix.board.fqbn }}
110+
platforms: ${{ matrix.board.platforms }}
111+
libraries: |
112+
# Install the library from the local path.
113+
- source-path: ./
114+
${{ matrix.libraries }}
115+
sketch-paths: |
116+
- examples/Flasher
117+
- examples/Test
118+
${{ matrix.sketch-paths }}
119+
enable-deltas-report: true
120+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
121+
122+
- name: Save sketches report as workflow artifact
123+
uses: actions/upload-artifact@v2
124+
with:
125+
if-no-files-found: error
126+
path: ${{ env.SKETCHES_REPORTS_PATH }}
127+
name: ${{ env.SKETCHES_REPORTS_PATH }}
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Compile Firmware
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-firmware.yml"
8+
- "extras/D11-Firmware/**"
9+
pull_request:
10+
paths:
11+
- ".github/workflows/compile-firmware.yml"
12+
- "extras/D11-Firmware/**"
13+
schedule:
14+
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
15+
- cron: "0 8 * * TUE"
16+
workflow_dispatch:
17+
repository_dispatch:
18+
19+
jobs:
20+
build:
21+
name: ${{ matrix.board.fqbn }}
22+
runs-on: ubuntu-latest
23+
24+
env:
25+
SKETCHES_REPORTS_PATH: sketches-reports
26+
27+
strategy:
28+
fail-fast: false
29+
30+
matrix:
31+
board:
32+
- fqbn: arduino:samd:mkrmotorshield:bootloader=0kb,pinmap=complete,lto=disabled
33+
platforms: |
34+
# Install MattairTech_Arduino:samd via Boards Manager for the toolchain
35+
- name: MattairTech_Arduino:samd
36+
source-url: https://www.mattairtech.com/software/arduino/package_MattairTech_index.json
37+
# This needs to match with the version of MattairTech_Arduino:samd the Arduino fork is based on in order to get the right tool versions
38+
version: 1.6.16
39+
# Install the platform with Motor Carrier support
40+
- name: arduino:samd
41+
source-url: https://github.com/arduino/ArduinoCore-samd.git
42+
version: mkrmotorcarrier
43+
44+
steps:
45+
- name: Checkout repository
46+
uses: actions/checkout@v2
47+
48+
- name: Compile firmware
49+
uses: arduino/compile-sketches@v1
50+
with:
51+
github-token: ${{ secrets.GITHUB_TOKEN }}
52+
fqbn: ${{ matrix.board.fqbn }}
53+
platforms: ${{ matrix.board.platforms }}
54+
libraries: |
55+
-
56+
sketch-paths: |
57+
- extras/D11-Firmware/D11-Firmware.ino
58+
enable-deltas-report: true
59+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
60+
61+
- name: Save sketches report as workflow artifact
62+
uses: actions/upload-artifact@v2
63+
with:
64+
if-no-files-found: error
65+
path: ${{ env.SKETCHES_REPORTS_PATH }}
66+
name: ${{ env.SKETCHES_REPORTS_PATH }}
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Report Size Deltas
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/report-size-deltas.yml"
8+
schedule:
9+
# Run at the minimum interval allowed by GitHub Actions.
10+
# Note: GitHub Actions periodically has outages which result in workflow failures.
11+
# In this event, the workflows will start passing again once the service recovers.
12+
- cron: "*/5 * * * *"
13+
workflow_dispatch:
14+
repository_dispatch:
15+
16+
jobs:
17+
report:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Comment size deltas reports to PRs
21+
uses: arduino/report-size-deltas@v1
22+
with:
23+
# The name of the workflow artifact created by the sketch compilation workflow
24+
sketches-reports-source: sketches-reports

.github/workflows/spell-check.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Spell Check
2+
3+
# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
pull_request:
7+
schedule:
8+
# Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates.
9+
- cron: "0 8 * * TUE"
10+
workflow_dispatch:
11+
repository_dispatch:
12+
13+
jobs:
14+
spellcheck:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
21+
- name: Spell check
22+
uses: codespell-project/actions-codespell@master

README.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
# MKRMotorCarrier library
1+
# ArduinoMotorCarrier library
22

3+
[![Check Arduino status](https://github.com/arduino-libraries/ArduinoMotorCarrier/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/ArduinoMotorCarrier/actions/workflows/check-arduino.yml)
4+
[![Compile Examples status](https://github.com/arduino-libraries/REPO_NAME/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/REPO_NAME/actions/workflows/compile-examples.yml)
5+
[![Spell Check status](https://github.com/arduino-libraries/ArduinoMotorCarrier/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/ArduinoMotorCarrier/actions/workflows/spell-check.yml)
36

4-
This library is designed to use the MKR Motor carrier. The shield supports micro servo motors, dc motors and dc motors with encoder. This library, therefore, has functions and creates objects to support such hardware. Objects are automatically created when "ArduinoMotorCarrier.h" is included, hence no need to initiate objects manually.
7+
This library is designed to use the MKR Motor Carrier. The shield supports micro servo motors, DC motors and DC motors with encoder. This library, therefore, has functions and creates objects to support such hardware. Objects are automatically created when "ArduinoMotorCarrier.h" is included, hence no need to initiate objects manually.
58

69
For more information about this library please visit us at
710

0 commit comments

Comments
 (0)