Skip to content

Commit 85b2a8b

Browse files
authored
Merge pull request #41 from arduino-libraries/ci
Use GitHub Actions for continuous integration
2 parents d701922 + 609afdd commit 85b2a8b

File tree

11 files changed

+214
-12
lines changed

11 files changed

+214
-12
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: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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:arduino_zero_edbg
35+
platforms: |
36+
- name: arduino:samd
37+
- fqbn: arduino:samd:mkr1000
38+
platforms: |
39+
- name: arduino:samd
40+
- fqbn: arduino:samd:mkrzero
41+
platforms: |
42+
- name: arduino:samd
43+
- fqbn: arduino:samd:mkrwifi1010
44+
platforms: |
45+
- name: arduino:samd
46+
- fqbn: arduino:samd:mkrfox1200
47+
platforms: |
48+
- name: arduino:samd
49+
- fqbn: arduino:samd:mkrwan1300
50+
platforms: |
51+
- name: arduino:samd
52+
- fqbn: arduino:samd:mkrwan1310
53+
platforms: |
54+
- name: arduino:samd
55+
- fqbn: arduino:samd:mkrgsm1400
56+
platforms: |
57+
- name: arduino:samd
58+
- fqbn: arduino:samd:mkrnb1500
59+
platforms: |
60+
- name: arduino:samd
61+
- fqbn: arduino:samd:mkrvidor4000
62+
platforms: |
63+
- name: arduino:samd
64+
- fqbn: arduino:samd:nano_33_iot
65+
platforms: |
66+
- name: arduino:samd
67+
- fqbn: arduino:samd:tian
68+
platforms: |
69+
- name: arduino:samd
70+
sketch-paths: |
71+
- examples/TianStandby
72+
- fqbn: arduino:nrf52:primo
73+
platforms: |
74+
- name: arduino:nrf52
75+
sketch-paths: |
76+
- examples/PrimoDeepSleep
77+
78+
steps:
79+
- name: Checkout repository
80+
uses: actions/checkout@v2
81+
82+
- name: Compile examples
83+
uses: arduino/compile-sketches@v1
84+
with:
85+
github-token: ${{ secrets.GITHUB_TOKEN }}
86+
fqbn: ${{ matrix.board.fqbn }}
87+
platforms: ${{ matrix.board.platforms }}
88+
libraries: |
89+
# Install the library from the local path.
90+
- source-path: ./
91+
- name: RTCZero
92+
sketch-paths: |
93+
# Sketches to compile for all boards
94+
- examples/AdcWakeup
95+
- examples/ExternalWakeup
96+
- examples/TimedWakeup
97+
# Board-specific sketches
98+
${{ matrix.board.sketch-paths }}
99+
enable-deltas-report: true
100+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
101+
102+
- name: Save sketches report as workflow artifact
103+
uses: actions/upload-artifact@v2
104+
with:
105+
if-no-files-found: error
106+
path: ${{ env.SKETCHES_REPORTS_PATH }}
107+
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.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Arduino Low Power library
22

3+
[![Check Arduino status](https://github.com/arduino-libraries/ArduinoLowPower/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/ArduinoLowPower/actions/workflows/check-arduino.yml)
4+
[![Compile Examples status](https://github.com/arduino-libraries/ArduinoLowPower/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/ArduinoLowPower/actions/workflows/compile-examples.yml)
5+
[![Spell Check status](https://github.com/arduino-libraries/ArduinoLowPower/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/ArduinoLowPower/actions/workflows/spell-check.yml)
6+
37
This library allows the use of the low power features of the SAMD21 MCU. This means your battery powered projects will have a longer battery life on boards like [MKRZero](https://store.arduino.cc/usa/arduino-mkrzero), [MKR1000](https://www.arduino.cc/en/Main/ArduinoMKR1000) and [MKRFox1200](https://www.arduino.cc/en/Main/ArduinoBoardMKRFox1200).
48

59
For more information about this library please visit us at

examples/PrimoDeepSleep/PrimoDeepSleep.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
Written by Chiara Ruggeri ([email protected])
55
66
This example for the Arduino Primo board shows how to use
7-
low power library to enter in power off mode and save power.
8-
This mode ensure the deepest power saving mode. If you need
7+
Arduino Low Power library to enter in power off mode and save power.
8+
This mode ensures the deepest power saving mode. If you need
99
a faster response from the board use standby function instead.
1010
1111
Please note that once exited from the deepest sleep mode the
1212
board will reset (so setup will be run again).
1313
1414
The functions enableWakeupFrom set the peripheral that will wake up
15-
the board. By calling it more than once you can choose more than
16-
a wakeup source.
15+
the board. By calling it more than once you can choose multiple
16+
wakeup sources.
1717
The board will be reset when it wakes up from power off.
1818
You can use wakeUpCause() function to find out what signals woke up
1919
the board if you use more than one wakeUpBy.. function.
@@ -27,7 +27,7 @@
2727
// Pin used to wakeup the board
2828
const int digitalPin = 10;
2929

30-
// Pin used in Compatarot module to wake up the board
30+
// Pin used in Comparator module to wake up the board
3131
const int analogPin = A0;
3232

3333

examples/TianStandby/TianStandby.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*
22
TianStandby
33
4-
This sketch demonstrates the usage of SAMD chip to furtherly reduce the power usage of Tian
4+
This sketch demonstrates the usage of SAMD chip to further reduce the power usage of the Tian
55
board. This method can be applied to any board with companion chips which expose a method
66
(via direct pin interrupt or via a command) to enter and exit standby.
7-
Sleep modes allow a significant drop in the power usage of a board while it does nothing waiting for an event to happen. Battery powered application can take advantage of these modes to enhance battery life significantly.
7+
Sleep modes allow a significant drop in the power usage of a board while it does nothing waiting for an event to happen. Battery powered applications can take advantage of these modes to enhance battery life significantly.
88
9-
In this sketch, the internal RTC of SAMD chip will wake up the processor every 20 seconds.
9+
In this sketch, the internal RTC of the SAMD chip will wake up the processor every 20 seconds.
1010
Before going to sleep, the SAMD chip tells the MIPS CPU to standby too.
1111
Please note that, if the processor is sleeping, a new sketch can't be uploaded. To overcome this, manually reset the board (usually with a single or double tap to the RESET button)
1212

keywords.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#######################################
2-
# Syntax Coloring Map For Energy Saving
2+
# Syntax Coloring Map For Arduino Low Power
33
#######################################
44

55
#######################################
@@ -30,4 +30,4 @@ wakeupReason KEYWORD2
3030
OTHER_WAKEUP LITERAL1
3131
GPIO_WAKEUP LITERAL1
3232
NFC_WAKEUP LITERAL1
33-
ANALOG_COMPARATOR_WAKEUP LITERAL1
33+
ANALOG_COMPARATOR_WAKEUP LITERAL1

0 commit comments

Comments
 (0)