Skip to content

Commit e9dd014

Browse files
authored
Merge pull request #9 from bcmi-labs/ci
Use GitHub Actions for continuous integration
2 parents d647b9c + 8441bd3 commit e9dd014

File tree

9 files changed

+307
-4
lines changed

9 files changed

+307
-4
lines changed

.codespellrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/spell-check/.codespellrc
2+
# See: https://github.com/codespell-project/codespell#using-a-config-file
3+
[codespell]
4+
# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here:
5+
ignore-words-list = ,
6+
skip = ./.git,./.licenses,__pycache__,node_modules,./go.mod,./go.sum,./package-lock.json,./poetry.lock,./yarn.lock,./src/lib,./src/lv_conf.h
7+
builtin = clear,informal,en-GB_to_en-US
8+
check-filenames =
9+
check-hidden =

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
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

Lines changed: 28 additions & 0 deletions
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: strict
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
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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:nanorp2040connect
38+
# See: https://github.com/arduino/compile-sketches#platforms
39+
platforms: |
40+
- name: arduino:mbed_nano
41+
42+
steps:
43+
- name: Checkout repository
44+
uses: actions/checkout@v2
45+
46+
- name: Compile examples
47+
uses: arduino/compile-sketches@v1
48+
with:
49+
github-token: ${{ secrets.GITHUB_TOKEN }}
50+
fqbn: ${{ matrix.board.fqbn }}
51+
platforms: ${{ matrix.board.platforms }}
52+
libraries: |
53+
# Install the library from the local path.
54+
- source-path: ./
55+
- name: lvgl
56+
# Additional library dependencies can be listed here.
57+
# See: https://github.com/arduino/compile-sketches#libraries
58+
sketch-paths: |
59+
- examples
60+
enable-deltas-report: true
61+
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
62+
63+
- name: Save sketches report as workflow artifact
64+
uses: actions/upload-artifact@v2
65+
with:
66+
if-no-files-found: error
67+
path: ${{ env.SKETCHES_REPORTS_PATH }}
68+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
69+
70+
report-size-deltas:
71+
needs: build
72+
# Run even if some compilations failed.
73+
if: always() && github.event_name == 'pull_request'
74+
runs-on: ubuntu-latest
75+
76+
steps:
77+
- name: Download sketches reports artifact
78+
id: download-artifact
79+
continue-on-error: true # If compilation failed for all boards then there are no artifacts
80+
uses: actions/download-artifact@v2
81+
with:
82+
name: ${{ env.SKETCHES_REPORTS_ARTIFACT_NAME }}
83+
path: ${{ env.SKETCHES_REPORTS_PATH }}
84+
85+
- name: Comment size deltas report to PR
86+
uses: arduino/report-size-deltas@v1
87+
# If actions/download-artifact failed, there are no artifacts to report from.
88+
if: steps.download-artifact.outcome == 'success'
89+
with:
90+
sketches-reports-source: ${{ env.SKETCHES_REPORTS_PATH }}

.github/workflows/spell-check.yml

Lines changed: 22 additions & 0 deletions
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

.github/workflows/sync-labels.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md
2+
name: Sync Labels
3+
4+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
5+
on:
6+
push:
7+
paths:
8+
- ".github/workflows/sync-labels.ya?ml"
9+
- ".github/label-configuration-files/*.ya?ml"
10+
pull_request:
11+
paths:
12+
- ".github/workflows/sync-labels.ya?ml"
13+
- ".github/label-configuration-files/*.ya?ml"
14+
schedule:
15+
# Run daily at 8 AM UTC to sync with changes to shared label configurations.
16+
- cron: "0 8 * * *"
17+
workflow_dispatch:
18+
repository_dispatch:
19+
20+
env:
21+
CONFIGURATIONS_FOLDER: .github/label-configuration-files
22+
CONFIGURATIONS_ARTIFACT: label-configuration-files
23+
24+
jobs:
25+
check:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v2
31+
32+
- name: Download JSON schema for labels configuration file
33+
id: download-schema
34+
uses: carlosperate/download-file-action@v1
35+
with:
36+
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json
37+
location: ${{ runner.temp }}/label-configuration-schema
38+
39+
- name: Install JSON schema validator
40+
run: |
41+
sudo npm install \
42+
--global \
43+
ajv-cli \
44+
ajv-formats
45+
46+
- name: Validate local labels configuration
47+
run: |
48+
# See: https://github.com/ajv-validator/ajv-cli#readme
49+
ajv validate \
50+
--all-errors \
51+
-c ajv-formats \
52+
-s "${{ steps.download-schema.outputs.file-path }}" \
53+
-d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}"
54+
55+
download:
56+
needs: check
57+
runs-on: ubuntu-latest
58+
59+
strategy:
60+
matrix:
61+
filename:
62+
# Filenames of the shared configurations to apply to the repository in addition to the local configuration.
63+
# https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels
64+
- universal.yml
65+
66+
steps:
67+
- name: Download
68+
uses: carlosperate/download-file-action@v1
69+
with:
70+
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}
71+
72+
- name: Pass configuration files to next job via workflow artifact
73+
uses: actions/upload-artifact@v2
74+
with:
75+
path: |
76+
*.yaml
77+
*.yml
78+
if-no-files-found: error
79+
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
80+
81+
sync:
82+
needs: download
83+
runs-on: ubuntu-latest
84+
85+
steps:
86+
- name: Set environment variables
87+
run: |
88+
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
89+
echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV"
90+
91+
- name: Determine whether to dry run
92+
id: dry-run
93+
if: >
94+
github.event_name == 'pull_request' ||
95+
(
96+
(
97+
github.event_name == 'push' ||
98+
github.event_name == 'workflow_dispatch'
99+
) &&
100+
github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
101+
)
102+
run: |
103+
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
104+
# configuration.
105+
echo "::set-output name=flag::--dry-run"
106+
107+
- name: Checkout repository
108+
uses: actions/checkout@v2
109+
110+
- name: Download configuration files artifact
111+
uses: actions/download-artifact@v2
112+
with:
113+
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
114+
path: ${{ env.CONFIGURATIONS_FOLDER }}
115+
116+
- name: Remove unneeded artifact
117+
uses: geekyeggo/delete-artifact@v1
118+
with:
119+
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
120+
121+
- name: Merge label configuration files
122+
run: |
123+
# Merge all configuration files
124+
shopt -s extglob
125+
cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}"
126+
127+
- name: Install github-label-sync
128+
run: sudo npm install --global github-label-sync
129+
130+
- name: Sync labels
131+
env:
132+
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133+
run: |
134+
# See: https://github.com/Financial-Times/github-label-sync
135+
github-label-sync \
136+
--labels "${{ env.MERGED_CONFIGURATION_PATH }}" \
137+
${{ steps.dry-run.outputs.flag }} \
138+
${{ github.repository }}

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
`Braccio++`
44
===========
55

6+
[![Check Arduino status](https://github.com/arduino-libraries/Braccio_v2_library/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino-libraries/Braccio_v2_library/actions/workflows/check-arduino.yml)
7+
[![Compile Examples status](https://github.com/arduino-libraries/Braccio_v2_library/actions/workflows/compile-examples-private.yml/badge.svg)](https://github.com/arduino-libraries/Braccio_v2_library/actions/workflows/compile-examples-private.yml)
8+
[![Spell Check status](https://github.com/arduino-libraries/Braccio_v2_library/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino-libraries/Braccio_v2_library/actions/workflows/spell-check.yml)
9+
610
This library allows you to control and interact with the 6 DOF Braccio++ robot arm.
711

812
## :mag_right: Resources
@@ -13,7 +17,7 @@ This library allows you to control and interact with the 6 DOF Braccio++ robot a
1317

1418
## :bug: Bugs & Issues
1519

16-
If you want to report an issue with this library, you can submit it to the [issue tracker](issues) of this repository. Remember to include as much detail as you can about your hardware set-up, code and steps for reproducing the issue. Make sure you're using an original Arduino board.
20+
If you want to report an issue with this library, you can submit it to the [issue tracker](https://github.com/arduino-libraries/Braccio_v2_library/issues) of this repository. Remember to include as much detail as you can about your hardware set-up, code and steps for reproducing the issue. Make sure you're using an original Arduino board.
1721

1822
## :technologist: Development
1923

@@ -29,4 +33,4 @@ You can submit your patches directly to this repository as Pull Requests. Please
2933

3034
## :yellow_heart: Donations
3135

32-
This open-source code is maintained by Arduino with the help of the community. We invest a considerable amount of time in testing code, optimizing it and introducing new features. Please consider [donating](https://www.arduino.cc/en/donate/) or [sponsoring](https://github.com/sponsors/arduino) to support our work, as well as [buying original Arduino boards](https://store.arduino.cc/) which is the best way to make sure our effort can continue in the long term.
36+
This open-source code is maintained by Arduino with the help of the community. We invest a considerable amount of time in testing code, optimizing it and introducing new features. Please consider [donating](https://www.arduino.cc/en/donate/) or [sponsoring](https://github.com/sponsors/arduino) to support our work, as well as [buying original Arduino boards](https://store.arduino.cc/) which is the best way to make sure our effort can continue in the long term.

examples/LearnByDoing/LearnByDoing.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ static mbed::FATFileSystem fs("fs");
9797

9898
void setup() {
9999

100-
// Call Braccio.begin() for default menu or pass a function for custom menu
101100
Serial.begin(115200);
102101

103102
// Mount file system for load/store movements
@@ -106,6 +105,7 @@ void setup() {
106105
err = fs.reformat(&bd);
107106
}
108107

108+
// Call Braccio.begin() for default menu or pass a function for custom menu
109109
Braccio.begin(customMenu);
110110
Serial.println("Replicate a movement");
111111
}

examples/Moving_Motors/Moving_Motors.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ void setup() {
77
Braccio.begin();
88
Serial.begin(115200);
99
while(!Serial){}
10-
Serial.println("Testing the motor angular moviment!");
10+
Serial.println("Testing the motor angular movement!");
1111
}
1212

1313
void loop() {

0 commit comments

Comments
 (0)