Skip to content

Commit

Permalink
Arduino libraries (#2)
Browse files Browse the repository at this point in the history
* esp8266 arduino core compatibility

* remove unused warning

* remove useless comment

from @per1234

Co-Authored-By: d-a-v <gauchard@laas.fr>

* For Arduino MKR Vidor-4000

* PagerServer example - how server.available() and server.print() works

* 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/bar@v2.3.4`). 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 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 "smoke test" examples compilation CI workflow

On every push or pull request that affects library source or example files, and periodically, compile all example
sketches for the specified boards.

* Report changes in memory usage that would result from merging a PR

On creation or commit to a pull request, a report of the resulting change in memory usage of the examples will be
commented to the PR thread.

* Fix compiler warning in htons

* change links to https if possible (arduino-libraries#66)

* Add docs

* Added pinout

* Adding sync-labels workflow for sharing one set of labels across all repos. (arduino-libraries#178)

* Missing virtual destructor results in compiler warning (arduino-libraries#153)

When `delete`ing an EthernetClient object, the compiler throws the following warning:
`warning: deleting object of polymorphic class type 'EthernetClient' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]`
Adding a virtual destructor solves this problem, see also here:
https://stackoverflow.com/questions/43282826/suppress-delete-non-virtual-dtor-warning-when-using-a-protected-non-virtual-dest

* rename sockindex to _sockindex

private variable in this class begin with _

* Fixing spelling error within examples/PagerServer. (arduino-libraries#179)

* Fixing CI build for Arduino SAM Due. (arduino-libraries#180)

The class EthernetServer, derived from Server, derived from Print does not contain a 'flush' method as for all other cores.

* same mac for all examples

* Use major version ref of `carlosperate/download-file-action` (arduino-libraries#181)

The `carlosperate/download-file-action` action is used in the GitHub Actions workflows as a convenient way to download
external resources.

A major version ref has been added to that repository. It will always point to the latest release of the "1" major
version series. This means it is no longer necessary to do a full pin of the action version in use as before.

Use of the major version ref will cause the workflow to use a stable version of the action, while also benefiting from
ongoing development to the action up until such time as a new major release of an action is made. At that time we would
need to evaluate whether any changes to the workflow are required by the breaking change that triggered the major
release before manually updating the major ref (e.g., uses: `carlosperate/download-file-action@v2`). I think this
approach strikes the right balance between stability and maintainability for these workflows.

* Standardize format of example sketch titles

* Correct typos in documentation

* Bump actions/checkout from 2 to 3

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update api.md

* Update api.md

* Update api.md

* Bump actions/upload-artifact from 2 to 3

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v2...v3)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump actions/download-artifact from 2 to 3

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 2 to 3.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v2...v3)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update api.md

Fix: Adding missing Bullet Points to Parameters and Returns

* Remove Paul Stoffregen from list of library maintainers

Done at the request of Paul Stoffregen.

* Release v2.0.1.

* Bump geekyeggo/delete-artifact from 1 to 2

Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 1 to 2.
- [Release notes](https://github.com/geekyeggo/delete-artifact/releases)
- [Commits](GeekyEggo/delete-artifact@v1...v2)

---
updated-dependencies:
- dependency-name: geekyeggo/delete-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump carlosperate/download-file-action from 1 to 2

Bumps [carlosperate/download-file-action](https://github.com/carlosperate/download-file-action) from 1 to 2.
- [Release notes](https://github.com/carlosperate/download-file-action/releases)
- [Commits](carlosperate/download-file-action@v1...v2)

---
updated-dependencies:
- dependency-name: carlosperate/download-file-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fixes static IPs for Arduino Nano Every

The example program WebClient does not work on the Arduino Nano Every when
DHCP is not available or commented out - the versions of Ethernet::begin()
using a static IP address fail.  I tested the example on Uno, Mega2560 and
Micro, it works on all of them using either DHCP or static IP.

This modifies the begin() method so that it uses IPAddress::raw_address()
instead of platform conditional code in the same way the DHCP version of
begin() does. With this change static addresses work on the Nano Every too.

* Release 2.0.2

* fixed no image on website issue

earlier the website didn't showed the preview on these images

* Bump actions/checkout from 3 to 4

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump geekyeggo/delete-artifact from 2 to 4 (arduino-libraries#245)

Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 2 to 4.
- [Release notes](https://github.com/geekyeggo/delete-artifact/releases)
- [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md)
- [Commits](GeekyEggo/delete-artifact@v2...v4)

---
updated-dependencies:
- dependency-name: geekyeggo/delete-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/download-artifact from 3 to 4 (arduino-libraries#244)

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](actions/download-artifact@v3...v4)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump actions/upload-artifact from 3 to 4 (arduino-libraries#243)

Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix regression report-size-deltas after updating upload-artifact. (arduino-libraries#253)

For more information see https://github.com/arduino/report-size-deltas/blob/main/docs/FAQ.md#size-deltas-report-workflow-triggered-by-schedule-event .

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: david gauchard <gauchard@laas.fr>
Co-authored-by: per1234 <accounts@perglass.com>
Co-authored-by: taylor <taylor@wiznet.io>
Co-authored-by: Cristian Maglie <c.maglie@arduino.cc>
Co-authored-by: Juraj Andrassy <juraj.andrassy@gmail.com>
Co-authored-by: Alexander Entinger <cto@lxrobotics.com>
Co-authored-by: Guðni Már Gilbert <gudnigi@vedur.is>
Co-authored-by: Rotzbua <Rotzbua@users.noreply.github.com>
Co-authored-by: Karl Söderby <35461661+karlsoderby@users.noreply.github.com>
Co-authored-by: fredlcore <github@code-it.de>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jacob Hylén <60390259+jacobhylen@users.noreply.github.com>
Co-authored-by: Hannes7eicher <hannes7eicher@gmail.com>
Co-authored-by: Michael Hieke <mghie@users.noreply.github.com>
Co-authored-by: Martino Facchin <m.facchin@arduino.cc>
Co-authored-by: Tanish <tanishazad03@gmail.com>
  • Loading branch information
17 people committed Mar 15, 2024
1 parent 4daa88f commit 6aadadd
Show file tree
Hide file tree
Showing 36 changed files with 3,223 additions and 190 deletions.
7 changes: 7 additions & 0 deletions .codespellrc
@@ -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 = nd,
check-filenames =
check-hidden =
skip = ./.git
10 changes: 10 additions & 0 deletions .github/dependabot.yml
@@ -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
@@ -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@v4

- name: Arduino Lint
uses: arduino/arduino-lint-action@v1
with:
compliance: specification
library-manager: update
# Always use this setting for official repositories. Remove for 3rd party projects.
official: true
project-type: library
128 changes: 128 additions & 0 deletions .github/workflows/compile-examples.yml
@@ -0,0 +1,128 @@
name: Compile Examples

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/compile-examples.yml"
- "examples/**"
- "src/**"
pull_request:
paths:
- ".github/workflows/compile-examples.yml"
- "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:

jobs:
build:
name: ${{ matrix.board.fqbn }}
runs-on: ubuntu-latest

env:
SKETCHES_REPORTS_PATH: sketches-reports

strategy:
fail-fast: false

matrix:
board:
- fqbn: arduino:avr:nano
platforms: |
- name: arduino:avr
artifact-name-suffix: arduino-avr-nano
- fqbn: arduino:avr:mega
platforms: |
- name: arduino:avr
artifact-name-suffix: arduino-avr-mega
- fqbn: arduino:avr:leonardo
platforms: |
- name: arduino:avr
artifact-name-suffix: arduino-avr-leonardo
- fqbn: arduino:megaavr:uno2018
platforms: |
- name: arduino:megaavr
artifact-name-suffix: arduino-megaavr-uno2018
- fqbn: arduino:megaavr:nona4809
platforms: |
- name: arduino:megaavr
artifact-name-suffix: arduino-megaavr-nona4809
- fqbn: arduino:sam:arduino_due_x_dbg
platforms: |
- name: arduino:sam
artifact-name-suffix: arduino-sam-arduino_due_x_dbg
- fqbn: arduino:samd:arduino_zero_edbg
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-arduino_zero_edbg
- fqbn: arduino:samd:mkr1000
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-mkr1000
- fqbn: arduino:samd:mkrzero
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-mkrzero
- fqbn: arduino:samd:mkrwifi1010
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-mkrwifi100
- fqbn: arduino:samd:mkrfox1200
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-mkr1200
- fqbn: arduino:samd:mkrwan1300
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-mkrwan1300
- fqbn: arduino:samd:mkrwan1310
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-mkrwan1310
- fqbn: arduino:samd:mkrgsm1400
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-mkrgsm1400
- fqbn: arduino:samd:mkrnb1500
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-mkrnb1500
- fqbn: arduino:samd:mkrvidor4000
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-mkrvidor4000
- fqbn: arduino:samd:nano_33_iot
platforms: |
- name: arduino:samd
artifact-name-suffix: arduino-samd-nano_33_iot

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

- name: Compile examples
uses: arduino/compile-sketches@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
fqbn: ${{ matrix.board.fqbn }}
platforms: ${{ matrix.board.platforms }}
libraries: |
# Install the library from the local path.
- source-path: ./
# Additional library dependencies can be listed here.
# See: https://github.com/arduino/compile-sketches#libraries
sketch-paths: |
- examples
enable-deltas-report: true
sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }}

- name: Save sketches report as workflow artifact
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
path: ${{ env.SKETCHES_REPORTS_PATH }}
name: sketches-report-${{ matrix.board.artifact-name-suffix }}
24 changes: 24 additions & 0 deletions .github/workflows/report-size-deltas.yml
@@ -0,0 +1,24 @@
name: Report Size Deltas

# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/report-size-deltas.yml"
schedule:
# Run at the minimum interval allowed by GitHub Actions.
# Note: GitHub Actions periodically has outages which result in workflow failures.
# In this event, the workflows will start passing again once the service recovers.
- cron: "*/5 * * * *"
workflow_dispatch:
repository_dispatch:

jobs:
report:
runs-on: ubuntu-latest
steps:
- name: Comment size deltas reports to PRs
uses: arduino/report-size-deltas@v1
with:
# Regex matching the names of the workflow artifacts created by the "Compile Examples" workflow
sketches-reports-source: ^sketches-report-.+
22 changes: 22 additions & 0 deletions .github/workflows/spell-check.yml
@@ -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@v4

- name: Spell check
uses: codespell-project/actions-codespell@master
138 changes: 138 additions & 0 deletions .github/workflows/sync-labels.yml
@@ -0,0 +1,138 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/sync-labels.md
name: Sync Labels

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/sync-labels.ya?ml"
- ".github/label-configuration-files/*.ya?ml"
pull_request:
paths:
- ".github/workflows/sync-labels.ya?ml"
- ".github/label-configuration-files/*.ya?ml"
schedule:
# Run daily at 8 AM UTC to sync with changes to shared label configurations.
- cron: "0 8 * * *"
workflow_dispatch:
repository_dispatch:

env:
CONFIGURATIONS_FOLDER: .github/label-configuration-files
CONFIGURATIONS_ARTIFACT: label-configuration-files

jobs:
check:
runs-on: ubuntu-latest

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

- name: Download JSON schema for labels configuration file
id: download-schema
uses: carlosperate/download-file-action@v2
with:
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/arduino-tooling-gh-label-configuration-schema.json
location: ${{ runner.temp }}/label-configuration-schema

- name: Install JSON schema validator
run: |
sudo npm install \
--global \
ajv-cli \
ajv-formats
- name: Validate local labels configuration
run: |
# See: https://github.com/ajv-validator/ajv-cli#readme
ajv validate \
--all-errors \
-c ajv-formats \
-s "${{ steps.download-schema.outputs.file-path }}" \
-d "${{ env.CONFIGURATIONS_FOLDER }}/*.{yml,yaml}"
download:
needs: check
runs-on: ubuntu-latest

strategy:
matrix:
filename:
# Filenames of the shared configurations to apply to the repository in addition to the local configuration.
# https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/sync-labels
- universal.yml

steps:
- name: Download
uses: carlosperate/download-file-action@v2
with:
file-url: https://raw.githubusercontent.com/arduino/tooling-project-assets/main/workflow-templates/assets/sync-labels/${{ matrix.filename }}

- name: Pass configuration files to next job via workflow artifact
uses: actions/upload-artifact@v4
with:
path: |
*.yaml
*.yml
if-no-files-found: error
name: ${{ env.CONFIGURATIONS_ARTIFACT }}

sync:
needs: download
runs-on: ubuntu-latest

steps:
- name: Set environment variables
run: |
# See: https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
echo "MERGED_CONFIGURATION_PATH=${{ runner.temp }}/labels.yml" >> "$GITHUB_ENV"
- name: Determine whether to dry run
id: dry-run
if: >
github.event_name == 'pull_request' ||
(
(
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch'
) &&
github.ref != format('refs/heads/{0}', github.event.repository.default_branch)
)
run: |
# Use of this flag in the github-label-sync command will cause it to only check the validity of the
# configuration.
echo "::set-output name=flag::--dry-run"
- name: Checkout repository
uses: actions/checkout@v4

- name: Download configuration files artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.CONFIGURATIONS_ARTIFACT }}
path: ${{ env.CONFIGURATIONS_FOLDER }}

- name: Remove unneeded artifact
uses: geekyeggo/delete-artifact@v4
with:
name: ${{ env.CONFIGURATIONS_ARTIFACT }}

- name: Merge label configuration files
run: |
# Merge all configuration files
shopt -s extglob
cat "${{ env.CONFIGURATIONS_FOLDER }}"/*.@(yml|yaml) > "${{ env.MERGED_CONFIGURATION_PATH }}"
- name: Install github-label-sync
run: sudo npm install --global github-label-sync

- name: Sync labels
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# See: https://github.com/Financial-Times/github-label-sync
github-label-sync \
--labels "${{ env.MERGED_CONFIGURATION_PATH }}" \
${{ steps.dry-run.outputs.flag }} \
${{ github.repository }}
6 changes: 2 additions & 4 deletions AUTHORS
@@ -1,9 +1,8 @@

Alberto Panu https://github.com/bigjohnson
Alasdair Allan https://github.com/aallan
Alice Pintus https://github.com/00alis
Adrian McEwen https://github.com/amcewen
Arduino LLC http://arduino.cc/
Arduino LLC https://arduino.cc/
Arnie97 https://github.com/Arnie97
Arturo Guadalupi https://github.com/agdl
Bjoern Hartmann https://people.eecs.berkeley.edu/~bjoern/
Expand Down Expand Up @@ -33,6 +32,5 @@ Richard Sim
Scott Fitzgerald https://github.com/shfitz
Thibaut Viard https://github.com/aethaniel
Tom Igoe https://github.com/tigoe
WizNet http://www.wiznet.co.kr
WIZnet http://www.wiznet.co.kr
Zach Eveland https://github.com/zeveland

0 comments on commit 6aadadd

Please sign in to comment.