Skip to content

Commit 16197ea

Browse files
authored
Merge pull request #6 from arduino-libraries/master
bump to upstream
2 parents 7cbcf56 + b16c38a commit 16197ea

26 files changed

+2932
-97
lines changed

.github/workflows/check-arduino.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020

2121
- name: Arduino Lint
22-
uses: arduino/arduino-lint-action@v1
22+
uses: arduino/arduino-lint-action@v2
2323
with:
2424
compliance: specification
2525
library-manager: update

.github/workflows/compile-examples.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,58 +34,75 @@ jobs:
3434
- fqbn: arduino:avr:nano
3535
platforms: |
3636
- name: arduino:avr
37+
artifact-name-suffix: arduino-avr-nano
3738
- fqbn: arduino:avr:mega
3839
platforms: |
3940
- name: arduino:avr
41+
artifact-name-suffix: arduino-avr-mega
4042
- fqbn: arduino:avr:leonardo
4143
platforms: |
4244
- name: arduino:avr
45+
artifact-name-suffix: arduino-avr-leonardo
4346
- fqbn: arduino:megaavr:uno2018
4447
platforms: |
4548
- name: arduino:megaavr
49+
artifact-name-suffix: arduino-megaavr-uno2018
4650
- fqbn: arduino:megaavr:nona4809
4751
platforms: |
4852
- name: arduino:megaavr
53+
artifact-name-suffix: arduino-megaavr-nona4809
4954
- fqbn: arduino:sam:arduino_due_x_dbg
5055
platforms: |
5156
- name: arduino:sam
57+
artifact-name-suffix: arduino-sam-arduino_due_x_dbg
5258
- fqbn: arduino:samd:arduino_zero_edbg
5359
platforms: |
5460
- name: arduino:samd
61+
artifact-name-suffix: arduino-samd-arduino_zero_edbg
5562
- fqbn: arduino:samd:mkr1000
5663
platforms: |
5764
- name: arduino:samd
65+
artifact-name-suffix: arduino-samd-mkr1000
5866
- fqbn: arduino:samd:mkrzero
5967
platforms: |
6068
- name: arduino:samd
69+
artifact-name-suffix: arduino-samd-mkrzero
6170
- fqbn: arduino:samd:mkrwifi1010
6271
platforms: |
6372
- name: arduino:samd
73+
artifact-name-suffix: arduino-samd-mkrwifi100
6474
- fqbn: arduino:samd:mkrfox1200
6575
platforms: |
6676
- name: arduino:samd
77+
artifact-name-suffix: arduino-samd-mkr1200
6778
- fqbn: arduino:samd:mkrwan1300
6879
platforms: |
6980
- name: arduino:samd
81+
artifact-name-suffix: arduino-samd-mkrwan1300
7082
- fqbn: arduino:samd:mkrwan1310
7183
platforms: |
7284
- name: arduino:samd
85+
artifact-name-suffix: arduino-samd-mkrwan1310
7386
- fqbn: arduino:samd:mkrgsm1400
7487
platforms: |
7588
- name: arduino:samd
89+
artifact-name-suffix: arduino-samd-mkrgsm1400
7690
- fqbn: arduino:samd:mkrnb1500
7791
platforms: |
7892
- name: arduino:samd
93+
artifact-name-suffix: arduino-samd-mkrnb1500
7994
- fqbn: arduino:samd:mkrvidor4000
8095
platforms: |
8196
- name: arduino:samd
97+
artifact-name-suffix: arduino-samd-mkrvidor4000
8298
- fqbn: arduino:samd:nano_33_iot
8399
platforms: |
84100
- name: arduino:samd
101+
artifact-name-suffix: arduino-samd-nano_33_iot
85102

86103
steps:
87104
- name: Checkout repository
88-
uses: actions/checkout@v2
105+
uses: actions/checkout@v4
89106

90107
- name: Compile examples
91108
uses: arduino/compile-sketches@v1
@@ -104,8 +121,8 @@ jobs:
104121
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}
105122

106123
- name: Save sketches report as workflow artifact
107-
uses: actions/upload-artifact@v2
124+
uses: actions/upload-artifact@v4
108125
with:
109126
if-no-files-found: error
110127
path: ${{ env.SKETCHES_REPORTS_PATH }}
111-
name: ${{ env.SKETCHES_REPORTS_PATH }}
128+
name: sketches-report-${{ matrix.board.artifact-name-suffix }}

.github/workflows/report-size-deltas.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ jobs:
2020
- name: Comment size deltas reports to PRs
2121
uses: arduino/report-size-deltas@v1
2222
with:
23-
# The name of the workflow artifact created by the sketch compilation workflow
24-
sketches-reports-source: sketches-reports
23+
# Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow
24+
sketches-reports-source: ^sketches-report-.+

.github/workflows/spell-check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020

2121
- name: Spell check
2222
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@v4
31+
32+
- name: Download JSON schema for labels configuration file
33+
id: download-schema
34+
uses: carlosperate/download-file-action@v2
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@v2
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@v4
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@v4
109+
110+
- name: Download configuration files artifact
111+
uses: actions/download-artifact@v4
112+
with:
113+
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
114+
path: ${{ env.CONFIGURATIONS_FOLDER }}
115+
116+
- name: Remove unneeded artifact
117+
uses: geekyeggo/delete-artifact@v5
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 }}

AUTHORS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Alberto Panu https://github.com/bigjohnson
22
Alasdair Allan https://github.com/aallan
33
Alice Pintus https://github.com/00alis
44
Adrian McEwen https://github.com/amcewen
5-
Arduino LLC http://arduino.cc/
5+
Arduino LLC https://arduino.cc/
66
Arnie97 https://github.com/Arnie97
77
Arturo Guadalupi https://github.com/agdl
88
Bjoern Hartmann https://people.eecs.berkeley.edu/~bjoern/

0 commit comments

Comments
 (0)