Skip to content

Commit d935c23

Browse files
authored
Merge pull request #137 from arduino-libraries/ci
Modernize continuous integration system
2 parents 6645bf4 + 0ff77b8 commit d935c23

10 files changed

+163
-16
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

.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
+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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: esp8266:esp8266:huzzah
35+
platforms: |
36+
- name: esp8266:esp8266
37+
source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
42+
43+
- name: Compile examples
44+
uses: arduino/compile-sketches@v1
45+
with:
46+
github-token: ${{ secrets.GITHUB_TOKEN }}
47+
fqbn: ${{ matrix.board.fqbn }}
48+
platforms: ${{ matrix.board.platforms }}
49+
libraries: |
50+
# Install the library from the local path.
51+
- source-path: ./
52+
# Additional library dependencies can be listed here.
53+
# See: https://github.com/arduino/compile-sketches#libraries
54+
sketch-paths: |
55+
- examples
56+
enable-deltas-report: true
57+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
58+
59+
- name: Save sketches report as workflow artifact
60+
uses: actions/upload-artifact@v2
61+
with:
62+
if-no-files-found: error
63+
path: ${{ env.SKETCHES_REPORTS_PATH }}
64+
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

.travis.yml

-10
This file was deleted.

NTPClient.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ bool NTPClient::update() {
128128

129129
unsigned long NTPClient::getEpochTime() const {
130130
return this->_timeOffset + // User offset
131-
this->_currentEpoc + // Epoc returned by the NTP server
131+
this->_currentEpoc + // Epoch returned by the NTP server
132132
((millis() - this->_lastUpdate) / 1000); // Time since last update
133133
}
134134

@@ -207,4 +207,4 @@ void NTPClient::sendNTPPacket() {
207207
void NTPClient::setRandomPort(unsigned int minValue, unsigned int maxValue) {
208208
randomSeed(analogRead(0));
209209
this->_port = random(minValue, maxValue);
210-
}
210+
}

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# NTPClient
22

3-
[![Build Status](https://travis-ci.org/arduino-libraries/NTPClient.svg?branch=master)](https://travis-ci.org/arduino-libraries/NTPClient)
3+
[![Check Arduino status](https://github.com/arduino-libraries/NTPClient/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/NTPClient/actions/workflows/check-arduino.yml)
4+
[![Compile Examples status](https://github.com/arduino-libraries/NTPClient/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/NTPClient/actions/workflows/compile-examples.yml)
5+
[![Spell Check status](https://github.com/arduino-libraries/NTPClient/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/NTPClient/actions/workflows/spell-check.yml)
46

57
Connect to a NTP server, here is how:
68

@@ -22,7 +24,7 @@ WiFiUDP ntpUDP;
2224
NTPClient timeClient(ntpUDP);
2325

2426
// You can specify the time server pool and the offset, (in seconds)
25-
// additionaly you can specify the update interval (in milliseconds).
27+
// additionally you can specify the update interval (in milliseconds).
2628
// NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000);
2729

2830
void setup(){
@@ -47,4 +49,4 @@ void loop() {
4749
```
4850
4951
## Function documentation
50-
`getEpochTime` returns the unix epoch, which are the seconds elapsed since 00:00:00 UTC on 1 January 1970 (leap seconds are ignored, every day is treated as having 86400 seconds). **Attention**: If you have set a time offset this time offset will be added to your epoch timestamp.
52+
`getEpochTime` returns the Unix epoch, which are the seconds elapsed since 00:00:00 UTC on 1 January 1970 (leap seconds are ignored, every day is treated as having 86400 seconds). **Attention**: If you have set a time offset this time offset will be added to your epoch timestamp.

examples/Advanced/Advanced.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const char *password = "<PASSWORD>";
1111
WiFiUDP ntpUDP;
1212

1313
// You can specify the time server pool and the offset (in seconds, can be
14-
// changed later with setTimeOffset() ). Additionaly you can specify the
14+
// changed later with setTimeOffset() ). Additionally you can specify the
1515
// update interval (in milliseconds, can be changed using setUpdateInterval() ).
1616
NTPClient timeClient(ntpUDP, "europe.pool.ntp.org", 3600, 60000);
1717

0 commit comments

Comments
 (0)