Skip to content

Commit e7f397c

Browse files
authored
Merge pull request #46 from per1234/ci
Use GitHub Actions for continuous integration
2 parents 716d286 + 6880ac8 commit e7f397c

11 files changed

+184
-7
lines changed

.codespellrc

Lines changed: 7 additions & 0 deletions
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

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
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

Lines changed: 28 additions & 0 deletions
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
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
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:avr:leonardo
35+
platforms: |
36+
- name: arduino:avr
37+
- fqbn: arduino:sam:arduino_due_x_dbg
38+
platforms: |
39+
- name: arduino:sam
40+
- fqbn: arduino:samd:mkrzero
41+
platforms: |
42+
- name: arduino:samd
43+
- fqbn: arduino:mbed_portenta:envie_m4
44+
platforms: |
45+
- name: arduino:mbed_portenta
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: Compile examples
61+
uses: arduino/compile-sketches@v1
62+
with:
63+
github-token: ${{ secrets.GITHUB_TOKEN }}
64+
fqbn: ${{ matrix.board.fqbn }}
65+
platforms: ${{ matrix.board.platforms }}
66+
libraries: |
67+
# Install the library from the local path.
68+
- source-path: ./
69+
# Additional library dependencies can be listed here.
70+
# See: https://github.com/arduino/compile-sketches#libraries
71+
sketch-paths: |
72+
- examples
73+
enable-deltas-report: true
74+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
75+
76+
- name: Save sketches report as workflow artifact
77+
uses: actions/upload-artifact@v2
78+
with:
79+
if-no-files-found: error
80+
path: ${{ env.SKETCHES_REPORTS_PATH }}
81+
name: ${{ env.SKETCHES_REPORTS_PATH }}
Lines changed: 24 additions & 0 deletions
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

Lines changed: 22 additions & 0 deletions
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.adoc

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
= Keyboard Library for Arduino =
1+
:repository-owner: arduino-libraries
2+
:repository-name: Keyboard
23

3-
This library allows an Arduino board with USB capabilities to act as a Keyboard.
4+
= {repository-name} Library for Arduino =
5+
6+
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"]
8+
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"]
9+
10+
This library allows an Arduino board with USB capabilities to act as a keyboard.
411

512
For more information about this library please visit us at
613
https://www.arduino.cc/reference/en/language/functions/usb/keyboard/

examples/Serial/Serial.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
1717
This example code is in the public domain.
1818
19-
http://www.arduino.cc/en/Tutorial/KeyboardSerial
19+
https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardSerial
2020
*/
2121

2222
#include "Keyboard.h"

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name=Keyboard
22
version=1.0.2
33
author=Arduino
44
maintainer=Arduino <[email protected]>
5-
sentence=Allows an Arduino/Genuino board with USB capabilites to act as a Keyboard.
5+
sentence=Allows an Arduino board with USB capabilities to act as a Keyboard.
66
paragraph=This library plugs on the HID library. It can be used with or without other HID-based libraries (Mouse, Gamepad etc)
77
category=Device Control
88
url=https://www.arduino.cc/reference/en/language/functions/usb/keyboard/

src/Keyboard.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,4 +335,3 @@ size_t Keyboard_::write(const uint8_t *buffer, size_t size) {
335335
Keyboard_ Keyboard;
336336

337337
#endif
338-

src/Keyboard.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
#define KEY_F24 0xFB
8585

8686

87-
// Low level key report: up to 6 keys and shift, ctrl etc at once
87+
// Low level key report: up to 6 keys and shift, ctrl etc at once
8888
typedef struct
8989
{
9090
uint8_t modifiers;
@@ -111,4 +111,3 @@ extern Keyboard_ Keyboard;
111111

112112
#endif
113113
#endif
114-

0 commit comments

Comments
 (0)