Skip to content

Commit ce281e6

Browse files
authored
Merge pull request #1 from per1234/ci
Use GitHub Actions for continuous integration
2 parents 20ba41b + 0dd94af commit ce281e6

10 files changed

+176
-5
lines changed

.codespellrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
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+
builtin = clear,informal,en-GB_to_en-US
6+
check-filenames =
7+
check-hidden =
8+
skip = ./.git

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# See: https://docs.github.com/en/code-security/supply-chain-security/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/code-security/supply-chain-security/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
11+
labels:
12+
- "topic: infrastructure"

.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/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+
# Change this to "update" once the library is added to the index.
26+
library-manager: submit
27+
# Always use this setting for official repositories. Remove for 3rd party projects.
28+
official: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Compile Examples
2+
3+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
4+
on:
5+
push:
6+
paths:
7+
- ".github/workflows/compile-examples-private.ya?ml"
8+
- "library.properties"
9+
- "examples/**"
10+
- "src/**"
11+
pull_request:
12+
paths:
13+
- ".github/workflows/compile-examples-private.ya?ml"
14+
- "library.properties"
15+
- "examples/**"
16+
- "src/**"
17+
schedule:
18+
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
19+
- cron: "0 8 * * TUE"
20+
workflow_dispatch:
21+
repository_dispatch:
22+
23+
env:
24+
SKETCHES_REPORTS_PATH: sketches-reports
25+
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports
26+
27+
jobs:
28+
build:
29+
name: ${{ matrix.board.fqbn }}
30+
runs-on: ubuntu-latest
31+
32+
strategy:
33+
fail-fast: false
34+
35+
matrix:
36+
board:
37+
- fqbn: arduino:mbed_nano:nano33ble
38+
platforms: |
39+
- name: arduino:mbed_nano
40+
- fqbn: arduino:mbed_nano:nanorp2040connect
41+
platforms: |
42+
- name: arduino:mbed_nano
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+
50+
steps:
51+
- name: Checkout repository
52+
uses: actions/checkout@v2
53+
54+
- name: Compile examples
55+
uses: arduino/compile-sketches@v1
56+
with:
57+
github-token: ${{ secrets.GITHUB_TOKEN }}
58+
fqbn: ${{ matrix.board.fqbn }}
59+
platforms: ${{ matrix.board.platforms }}
60+
libraries: |
61+
# Install the library from the local path.
62+
- source-path: ./
63+
# Additional library dependencies can be listed here.
64+
# See: https://github.com/arduino/compile-sketches#libraries
65+
sketch-paths: |
66+
- examples
67+
enable-deltas-report: true
68+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
69+
70+
- name: Save sketches report as workflow artifact
71+
uses: actions/upload-artifact@v2
72+
with:
73+
if-no-files-found: error
74+
path: ${{ env.SKETCHES_REPORTS_PATH }}
75+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
76+
77+
report-size-deltas:
78+
needs: build
79+
# Run even if some compilations failed.
80+
if: always() && github.event_name == 'pull_request'
81+
runs-on: ubuntu-latest
82+
83+
steps:
84+
- name: Download sketches reports artifact
85+
id: download-artifact
86+
continue-on-error: true # If compilation failed for all boards then there are no artifacts
87+
uses: actions/download-artifact@v2
88+
with:
89+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
90+
path: ${{ env.SKETCHES_REPORTS_PATH }}
91+
92+
- name: Comment size deltas report to PR
93+
uses: arduino/report-size-deltas@v1
94+
# If actions/download-artifact failed, there are no artifacts to report from.
95+
if: steps.download-artifact.outcome == 'success'
96+
with:
97+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}

.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/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-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
`Arduino_ThreadsafeIO`
2-
======================
2+
======================
3+
4+
[![Check Arduino status](https://github.com/arduino-libraries/Arduino_ThreadsafeIO/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_ThreadsafeIO/actions/workflows/check-arduino.yml)
5+
[![Compile Examples status](https://github.com/arduino-libraries/Arduino_ThreadsafeIO/actions/workflows/compile-examples-private.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_ThreadsafeIO/actions/workflows/compile-examples-private.yml)
6+
[![Spell Check status](https://github.com/arduino-libraries/Arduino_ThreadsafeIO/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_ThreadsafeIO/actions/workflows/spell-check.yml)

examples/ts_wire/ts_wire.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void lsm6dsox_thread_func()
8080
{
8181
/* Sleep between 5 and 500 ms */
8282
rtos::ThisThread::sleep_for(rtos::Kernel::Clock::duration_u32(random(5,500)));
83-
/* Try to read some data from the BMP3888. */
83+
/* Try to read some data from the LSM6DSOX. */
8484
byte const who_am_i = lsm6dsox_read_reg(LSM6DSOX_WHO_AM_I_REG);
8585
/* Print thread id and chip id value to serial. */
8686
char msg[64] = {0};

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ paragraph=
77
category=Communication
88
url=
99
architectures=mbed,mbed_portenta,mbed_nano
10-
include=Arduino_ThreadsafeIO.h
10+
includes=Arduino_ThreadsafeIO.h

src/spi/SpiDispatcher.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void SpiDispatcher::begin()
9595
{
9696
SPI.begin();
9797
_thread.start(mbed::callback(this, &SpiDispatcher::threadFunc)); /* TODO: Check return code */
98-
/* Is is necessary to wait until the SpiDispatcher::threadFunc()
98+
/* It is necessary to wait until the SpiDispatcher::threadFunc()
9999
* has started, otherwise other threads might trigger IO requests
100100
* before this thread is actually running.
101101
*/

src/wire/WireDispatcher.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void WireDispatcher::begin()
9595
{
9696
Wire.begin();
9797
_thread.start(mbed::callback(this, &WireDispatcher::threadFunc)); /* TODO: Check return code */
98-
/* Is is necessary to wait until the WireDispatcher::threadFunc()
98+
/* It is necessary to wait until the WireDispatcher::threadFunc()
9999
* has started, otherwise other threads might trigger IO requests
100100
* before this thread is actually running.
101101
*/

0 commit comments

Comments
 (0)