diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..5af8717 --- /dev/null +++ b/.codespellrc @@ -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 = diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml new file mode 100644 index 0000000..6e3035d --- /dev/null +++ b/.github/workflows/check-arduino.yml @@ -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 diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 9be8024..e84ce3b 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -1,16 +1,24 @@ 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 @@ -18,6 +26,7 @@ env: jobs: compile-test: + name: compile for ${{ matrix.fqbn }} runs-on: ubuntu-latest env: @@ -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 @@ -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 }} diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 0000000..4601442 --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -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 diff --git a/README.md b/README.md new file mode 100644 index 0000000..5b40187 --- /dev/null +++ b/README.md @@ -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. diff --git a/examples/Blocks/data_writer.inot b/examples/Blocks/data_writer.inot index fbd6b5e..d3e0e70 100644 --- a/examples/Blocks/data_writer.inot +++ b/examples/Blocks/data_writer.inot @@ -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) @@ -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(); diff --git a/examples/SharedResources/SharedVariables.h b/examples/SharedResources/SharedVariables.h index 07d64e2..51b8363 100644 --- a/examples/SharedResources/SharedVariables.h +++ b/examples/SharedResources/SharedVariables.h @@ -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]; diff --git a/examples/SharedResourcesVariousLibraries/SharedVariables.h b/examples/SharedResourcesVariousLibraries/SharedVariables.h index 0d4a76b..ca037c5 100644 --- a/examples/SharedResourcesVariousLibraries/SharedVariables.h +++ b/examples/SharedResourcesVariousLibraries/SharedVariables.h @@ -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]; diff --git a/examples/i2c_concurrent/SharedVariables.h b/examples/i2c_concurrent/SharedVariables.h index 07d64e2..51b8363 100644 --- a/examples/i2c_concurrent/SharedVariables.h +++ b/examples/i2c_concurrent/SharedVariables.h @@ -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]; diff --git a/library.properties b/library.properties index 464f2be..05de5ff 100644 --- a/library.properties +++ b/library.properties @@ -2,8 +2,8 @@ name=Arduino_Threads version=0.0.1 author=Arduino maintainer=Arduino -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