Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Update continuous integration system (#54)
Browse files Browse the repository at this point in the history
* Add library.properties to "Compile Examples" workflow path filter

The library.properties metadata file content is a factor in compilation, so the workflow should run on any change to this
file.

* Use major version refs of sketch compilation actions

Previously, due to the lack of a release, the development versions of the sketch compilation actions were used. Using
release versions provides a more stable CI system for the ArduinoCore-mbed project.

Use of the major version ref will cause the workflow to benefit from ongoing development to the actions up until such
time as a new major release of an action is made, at which time we would need to evaluate whether any changes to the
workflow are required by the breaking change that triggered the major release before updating the major ref
(e.g., uses: 	`arduino/compile-sketches@v2`).

* Optimize management of size deltas report when there are errors

There may sometimes be failed compilations that are not related to the current pull request (e.g., breakage caused by an
external change that will be fixed separately). In this case, it is still valuable to publish a size deltas report for
the compilations that passed.

* Configure Dependabot to check for outdated actions used in workflows

Dependabot will periodically check the versions of all actions used in the repository's workflows. If any are found to
be outdated, it will submit a pull request to update them.
NOTE: Dependabot's PRs will sometimes try to pin to the patch version of the action (e.g., updating `uses: foo/bar@v1`
to `uses: foo/[email protected]`). When the action author has provided a major version ref, use that instead
(e.g., `uses: foo/bar@v2`). Dependabot will automatically close its PR once the workflow has been updated.
More information:
https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot

* Add badge to readme for "Compile Examples" workflow

This will show the current status of the CI workflow at a glance.

* Add CI workflow to check for commonly misspelled words

On every push, pull request, and periodically, use the codespell-project/actions-codespell action to check for commonly
misspelled words.

In the event of a false positive, the problematic word should be added, in all lowercase, to the ignore-words-list field
of ./.codespellrc. Regardless of the case of the word in the false positive, it must be in all lowercase in the ignore
list. The ignore list is comma-separated with no spaces.

* Correct typos in comments and documentation

* Add CI workflow to do Arduino project-specific linting

On every push, pull request, and periodically, run Arduino Lint to check for common problems not related to the project
code.

* Add license file

This defines the license in a standardized place, which allows GitHub's automated license detection system to detect the
license type:
https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/licensing-a-repository#detecting-a-license

This is the exact license text provided by choosealicense.com
This text should not be modified in any way. Doing so may interfere with GitHub's license detection or even the licence's
function as a legal instrument.

* Use release version of boards platform in "Compile Examples" workflow

Previously, the development version of the boards platform was used to compile the example sketches in the CI workflow.
  • Loading branch information
per1234 authored May 12, 2021
1 parent e44e869 commit aebc097
Show file tree
Hide file tree
Showing 19 changed files with 619 additions and 62 deletions.
7 changes: 7 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 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 = ,
check-filenames =
check-hidden =
skip = ./.git,./src/utility/ioexpander/I2Cdev.*,./src/utility/ioexpander/TCA6424A.*,./src/utility/QEI,./src/utility/RS485,
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file
version: 2

updates:
# Configure check for outdated GitHub Actions actions in workflows.
# See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot
- package-ecosystem: github-actions
directory: / # Check the repository's workflows under /.github/workflows/
schedule:
interval: daily
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/free-pro-team@latest/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
library-manager: submit
# Always use this setting for official repositories. Remove for 3rd party projects.
official: true
project-type: library
44 changes: 13 additions & 31 deletions .github/workflows/compile-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ on:
pull_request:
paths:
- ".github/workflows/compile-examples.yml"
- "library.properties"
- "src/**"
- "examples/**"
push:
paths:
- ".github/workflows/compile-examples.yml"
- "library.properties"
- "src/**"
- "examples/**"
# Scheduled trigger checks for breakage caused by changes to external resources (libraries, platforms)
Expand All @@ -30,42 +32,16 @@ jobs:
compile-examples:
runs-on: ubuntu-latest

env:
ARDUINOCORE_MBED_STAGING_PATH: extras/ArduinoCore-mbed
ARDUINOCORE_API_STAGING_PATH: extras/ArduinoCore-API

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

# It's necessary to checkout the platform before installing it so that the ArduinoCore-API dependency can be added
- name: Checkout ArduinoCore-mbed
uses: actions/checkout@v2
with:
repository: arduino/ArduinoCore-mbed
# The arduino/actions/libraries/compile-examples action will install the platform from this path
path: ${{ env.ARDUINOCORE_MBED_STAGING_PATH }}

- name: Checkout ArduinoCore-API
uses: actions/checkout@v2
with:
repository: arduino/ArduinoCore-API
path: ${{ env.ARDUINOCORE_API_STAGING_PATH }}

- name: Install ArduinoCore-API
run: |
mv "${{ env.ARDUINOCORE_API_STAGING_PATH }}/api" "${{ env.ARDUINOCORE_MBED_STAGING_PATH }}/cores/arduino"
- name: Compile example sketches
uses: arduino/compile-sketches@main
uses: arduino/compile-sketches@v1
with:
fqbn: arduino:mbed:envie_m7
fqbn: arduino:mbed_portenta:envie_m7
platforms: |
# Install Arduino mbed-Enabled Boards via Boards Manager for the toolchain
- name: arduino:mbed
# Overwrite the Arduino mbed-Enabled Boards release version with version from the tip of the master branch (located in local path because of the need to first install ArduinoCore-API)
- source-path: extras/ArduinoCore-mbed
name: arduino:mbed
- name: arduino:mbed_portenta
enable-deltas-report: true
enable-warnings-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
Expand All @@ -74,21 +50,27 @@ jobs:
- name: Save memory usage change report as artifact
uses: actions/upload-artifact@v2
with:
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}

report:
needs: compile-examples
# 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
if: always() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
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/free-pro-team@latest/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
Loading

0 comments on commit aebc097

Please sign in to comment.