Skip to content

Commit aebc097

Browse files
authored
Update continuous integration system (#54)
* 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.
1 parent e44e869 commit aebc097

File tree

19 files changed

+619
-62
lines changed

19 files changed

+619
-62
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,./src/utility/ioexpander/I2Cdev.*,./src/utility/ioexpander/TCA6424A.*,./src/utility/QEI,./src/utility/RS485,

.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: strict
25+
library-manager: submit
26+
# Always use this setting for official repositories. Remove for 3rd party projects.
27+
official: true
28+
project-type: library

.github/workflows/compile-examples.yml

+13-31
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ on:
44
pull_request:
55
paths:
66
- ".github/workflows/compile-examples.yml"
7+
- "library.properties"
78
- "src/**"
89
- "examples/**"
910
push:
1011
paths:
1112
- ".github/workflows/compile-examples.yml"
13+
- "library.properties"
1214
- "src/**"
1315
- "examples/**"
1416
# Scheduled trigger checks for breakage caused by changes to external resources (libraries, platforms)
@@ -30,42 +32,16 @@ jobs:
3032
compile-examples:
3133
runs-on: ubuntu-latest
3234

33-
env:
34-
ARDUINOCORE_MBED_STAGING_PATH: extras/ArduinoCore-mbed
35-
ARDUINOCORE_API_STAGING_PATH: extras/ArduinoCore-API
36-
3735
steps:
3836
- name: Checkout repository
3937
uses: actions/checkout@v2
4038

41-
# It's necessary to checkout the platform before installing it so that the ArduinoCore-API dependency can be added
42-
- name: Checkout ArduinoCore-mbed
43-
uses: actions/checkout@v2
44-
with:
45-
repository: arduino/ArduinoCore-mbed
46-
# The arduino/actions/libraries/compile-examples action will install the platform from this path
47-
path: ${{ env.ARDUINOCORE_MBED_STAGING_PATH }}
48-
49-
- name: Checkout ArduinoCore-API
50-
uses: actions/checkout@v2
51-
with:
52-
repository: arduino/ArduinoCore-API
53-
path: ${{ env.ARDUINOCORE_API_STAGING_PATH }}
54-
55-
- name: Install ArduinoCore-API
56-
run: |
57-
mv "${{ env.ARDUINOCORE_API_STAGING_PATH }}/api" "${{ env.ARDUINOCORE_MBED_STAGING_PATH }}/cores/arduino"
58-
5939
- name: Compile example sketches
60-
uses: arduino/compile-sketches@main
40+
uses: arduino/compile-sketches@v1
6141
with:
62-
fqbn: arduino:mbed:envie_m7
42+
fqbn: arduino:mbed_portenta:envie_m7
6343
platforms: |
64-
# Install Arduino mbed-Enabled Boards via Boards Manager for the toolchain
65-
- name: arduino:mbed
66-
# 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)
67-
- source-path: extras/ArduinoCore-mbed
68-
name: arduino:mbed
44+
- name: arduino:mbed_portenta
6945
enable-deltas-report: true
7046
enable-warnings-report: true
7147
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
@@ -74,21 +50,27 @@ jobs:
7450
- name: Save memory usage change report as artifact
7551
uses: actions/upload-artifact@v2
7652
with:
53+
if-no-files-found: error
7754
path: ${{ env.SKETCHES_REPORTS_PATH }}
7855
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
7956

8057
report:
8158
needs: compile-examples
8259
# Only run the job when the workflow is triggered by a pull request from this repository (because arduino/report-size-deltas requires write permissions)
83-
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
60+
if: always() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
8461
runs-on: ubuntu-latest
8562
steps:
8663
- name: Download sketches reports artifact
64+
id: download-artifact
65+
continue-on-error: true # If compilation failed for all boards then there are no artifacts
8766
uses: actions/download-artifact@v2
8867
with:
8968
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
9069
path: ${{ env.SKETCHES_REPORTS_PATH }}
9170

92-
- uses: arduino/report-size-deltas@main
71+
- name: Comment size deltas report to PR
72+
uses: arduino/report-size-deltas@v1
73+
# If actions/download-artifact failed, there are no artifacts to report from.
74+
if: steps.download-artifact.outcome == 'success'
9375
with:
9476
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/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

0 commit comments

Comments
 (0)