Skip to content

Expand CI system #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 15 commits into from
Sep 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See: https://github.com/codespell-project/codespell#using-a-config-file
[codespell]
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
ignore-words-list = inot
skip = ./.git
builtin = clear,informal,en-GB_to_en-US
check-filenames =
check-hidden =
28 changes: 28 additions & 0 deletions .github/workflows/check-arduino.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Check Arduino

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
pull_request:
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint.
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Arduino Lint
uses: arduino/arduino-lint-action@v1
with:
compliance: strict
# Change this to "update" once the library is added to the index.
library-manager: submit
# Always use this setting for official repositories. Remove for 3rd party projects.
official: true
23 changes: 18 additions & 5 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
name: Compile Examples

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
pull_request:
paths:
- ".github/workflows/compile-examples.yml"
- "library.properties"
- "examples/**"
- "src/**"
push:
paths:
- ".github/workflows/compile-examples.yml"
- "library.properties"
- "examples/**"
- "src/**"
schedule:
# Run every Tuesday at 8 AM UTC to catch breakage caused by changes to external resources (libraries, platforms).
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

env:
SKETCHES_REPORTS_PATH: sketches-reports
SKETCHES_REPORTS_ARTIFACT_NAME: sketches-reports

jobs:
compile-test:
name: compile for ${{ matrix.fqbn }}
runs-on: ubuntu-latest

env:
Expand Down Expand Up @@ -63,7 +72,6 @@ jobs:
uses: actions/checkout@v2
with:
repository: arduino/ArduinoCore-API
# as specified at https://github.com/arduino/ArduinoCore-mbed/blob/master/README.md#installation
path: ${{ env.ARDUINOCORE_API_STAGING_PATH }}

- name: Install ArduinoCore-API
Expand Down Expand Up @@ -92,24 +100,29 @@ jobs:
verbose: 'true'

- name: Save memory usage change report as artifact
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v2
with:
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}

report-size-deltas:
needs: compile-test
# Only run the job when the workflow is triggered by a pull request from this repository (because arduino/report-size-deltas requires write permissions)
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
# Run even if some compilations failed.
if: always() && github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Download sketches reports artifact
id: download-artifact
continue-on-error: true # If compilation failed for all boards then there are no artifacts
uses: actions/download-artifact@v2
with:
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
path: ${{ env.SKETCHES_REPORTS_PATH }}

- uses: arduino/report-size-deltas@main
- name: Comment size deltas report to PR
uses: arduino/report-size-deltas@v1
# If actions/download-artifact failed, there are no artifacts to report from.
if: steps.download-artifact.outcome == 'success'
with:
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}
22 changes: 22 additions & 0 deletions .github/workflows/spell-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Spell Check

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
pull_request:
schedule:
# Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates.
- cron: "0 8 * * TUE"
workflow_dispatch:
repository_dispatch:

jobs:
spellcheck:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Spell check
uses: codespell-project/actions-codespell@master
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# `Arduino_Threads` library for Arduino

[![Compile Examples status](https://github.com/arduino-libraries/Arduino_Threads/actions/workflows/compile-examples.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_Threads/actions/workflows/compile-examples.yml)
[![Check Arduino status](https://github.com/arduino-libraries/Arduino_Threads/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_Threads/actions/workflows/check-arduino.yml)
[![Spell Check status](https://github.com/arduino-libraries/Arduino_Threads/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Arduino_Threads/actions/workflows/spell-check.yml)

This library makes it easy to use the multi-threading capability of [Arduino](https://www.arduino.cc/) boards that use an [Mbed OS](https://os.mbed.com/docs/mbed-os/latest/introduction/index.html)-based core library.
4 changes: 2 additions & 2 deletions examples/Blocks/data_writer.inot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

/*
* An 'int' SINK with a size of '0'. This kind of SINK has no buffer so the reading thread
* will block until the writing thread has written something, or viceversa.
* will block until the writing thread has written something, or vice versa.
*/
SINK(in, int, 0)

Expand All @@ -10,7 +10,7 @@ void setup() {
}

void loop() {
// Read an 'int' from the SINK and discards it. Since there is basically no delay in the loop
// Read an 'int' from the SINK and discard it. Since there is basically no delay in the loop
// this call will surely block until something comes from the connected SOURCE. In this case
// the pace is dictated by the SOURCE that sends data every 100 ms.
in.read();
Expand Down
2 changes: 1 addition & 1 deletion examples/SharedResources/SharedVariables.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// The preprocessor should enforce that all variables belonging here are declared Shared
// There's no risk to spill other variables around since they are all private memeber of the automatic class
// There's no risk to spill other variables around since they are all private members of the automatic class

struct i2cScanResults {
uint8_t address[128];
Expand Down
2 changes: 1 addition & 1 deletion examples/SharedResourcesVariousLibraries/SharedVariables.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// The preprocessor should enforce that all variables belonging here are declared Shared
// There's no risk to spill other variables around since they are all private memeber of the automatic class
// There's no risk to spill other variables around since they are all private members of the automatic class

struct i2cScanResults {
uint8_t address[128];
Expand Down
2 changes: 1 addition & 1 deletion examples/i2c_concurrent/SharedVariables.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// The preprocessor should enforce that all variables belonging here are declared Shared
// There's no risk to spill other variables around since they are all private memeber of the automatic class
// There's no risk to spill other variables around since they are all private members of the automatic class

struct i2cScanResults {
uint8_t address[128];
Expand Down
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name=Arduino_Threads
version=0.0.1
author=Arduino
maintainer=Arduino <[email protected]>
sentence=Easy multi-threading for your mbed based Arduino.
paragraph=This library allows an easy access to the multi-threading capability inherent in all mbed based Arduino boards.
sentence=Easy multi-threading for your Mbed OS-based Arduino.
paragraph=This library allows an easy access to the multi-threading capability inherent in all Mbed OS-based Arduino boards.
category=Other
url=https://github.com/bcmi-labs/Arduino_Threads
architectures=mbed
Expand Down