From 19d2309eec5424eceaa6468e4384b43cf0be2a30 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 21 Jan 2021 00:05:15 -0800 Subject: [PATCH 1/4] 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. --- .codespellrc | 6 ++++++ .github/workflows/spell-check.yml | 24 ++++++++++++++++++++++++ README.adoc | 8 +++++++- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .codespellrc create mode 100644 .github/workflows/spell-check.yml diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..abd750c --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[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 diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 0000000..7ad1475 --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -0,0 +1,24 @@ +name: Spell Check + +on: + pull_request: + push: + schedule: + # Run every Saturday at 3 AM UTC to catch new misspelling detections resulting from dictionary updates. + - cron: "0 3 * * 6" + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch + repository_dispatch: + +jobs: + spellcheck: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # See: https://github.com/codespell-project/actions-codespell/blob/master/README.md + - name: Spell check + uses: codespell-project/actions-codespell@master diff --git a/README.adoc b/README.adoc index 5972f0f..0be4e09 100644 --- a/README.adoc +++ b/README.adoc @@ -1,4 +1,10 @@ -= ArduinoECCX08 = +// Define the repository information in these attributes +:repository-owner: arduino-libraries +:repository-name: ArduinoECCX08 + += {repository-name} = + +image:https://github.com/{repository-owner}/{repository-name}/workflows/Spell%20Check/badge.svg["Spell Check Status", link="https://github.com/{repository-owner}/{repository-name}/actions?workflow=Spell+Check"] Arduino Library for the Atmel/Microchip ECC508 and ECC608 crypto chips From edbcf2ac70518bcac7ddb92048e61135a2d69a91 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 21 Jan 2021 00:06:17 -0800 Subject: [PATCH 2/4] Add "smoke test" examples compilation CI workflow On every push or pull request that affects library source or example files, compile all example sketches for the specified boards. --- .github/workflows/compile-examples.yml | 58 ++++++++++++++++++++++++++ README.adoc | 1 + 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/compile-examples.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml new file mode 100644 index 0000000..3282f6d --- /dev/null +++ b/.github/workflows/compile-examples.yml @@ -0,0 +1,58 @@ +name: Compile Examples + +on: + pull_request: + paths: + - ".github/workflows/compile-examples.yml" + - "examples/**" + - "src/**" + push: + paths: + - ".github/workflows/compile-examples.yml" + - "examples/**" + - "src/**" + # Scheduled trigger checks for breakage caused by changes to external resources (libraries, platforms) + schedule: + # run every Saturday at 3 AM UTC + - cron: "0 3 * * 6" + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch + repository_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + board: + - fqbn: arduino:mbed:envie_m7 + - fqbn: arduino:megaavr:uno2018 + - fqbn: arduino:samd:mkr1000 + - fqbn: arduino:samd:mkrwifi1010 + - fqbn: arduino:samd:nano_33_iot + - fqbn: arduino:samd:mkrwan1300 + - fqbn: arduino:samd:mkrwan1310 + - fqbn: arduino:samd:mkrgsm1400 + - fqbn: arduino:samd:mkrnb1500 + - fqbn: arduino:samd:mkrvidor4000 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Compile examples + uses: arduino/compile-sketches@main + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + fqbn: ${{ matrix.board.fqbn }} + 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/ diff --git a/README.adoc b/README.adoc index 0be4e09..0664572 100644 --- a/README.adoc +++ b/README.adoc @@ -4,6 +4,7 @@ = {repository-name} = +image:https://github.com/{repository-owner}/{repository-name}/workflows/Compile%20Examples/badge.svg["Compile Examples Status", link="https://github.com/{repository-owner}/{repository-name}/actions?workflow=Compile+Examples"] image:https://github.com/{repository-owner}/{repository-name}/workflows/Spell%20Check/badge.svg["Spell Check Status", link="https://github.com/{repository-owner}/{repository-name}/actions?workflow=Spell+Check"] Arduino Library for the Atmel/Microchip ECC508 and ECC608 crypto chips From 4814aa3949330d0dd7118b279847d39df9d66f05 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 21 Jan 2021 00:06:38 -0800 Subject: [PATCH 3/4] 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. --- .github/workflows/compile-examples.yml | 11 +++++++++++ .github/workflows/report-size-deltas.yml | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/report-size-deltas.yml diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 3282f6d..f7aa01d 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -24,6 +24,9 @@ jobs: build: runs-on: ubuntu-latest + env: + SKETCHES_REPORTS_PATH: sketches-reports + strategy: fail-fast: false @@ -56,3 +59,11 @@ jobs: # See: https://github.com/arduino/compile-sketches#libraries sketch-paths: | - ./examples/ + enable-deltas-report: true + sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} + + - name: Save memory usage change report as artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ env.SKETCHES_REPORTS_PATH }} + path: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..c69650f --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,21 @@ +name: Report Size Deltas + +on: + schedule: + - cron: '*/5 * * * *' + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch + repository_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + + steps: + # See: https://github.com/arduino/actions/blob/master/libraries/report-size-deltas/README.md + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@main + with: + # The name of the workflow artifact created by the "Compile Examples" workflow + sketches-reports-source: sketches-reports From ccb3f210337f7486d391ee216fca06c475ebf49f Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 21 Jan 2021 00:06:56 -0800 Subject: [PATCH 4/4] Add CI workflow to do Arduino project-specific linting On every push or pull request, run Arduino Lint to check for common problems not related to the project code. --- .github/workflows/arduino-lint.yml | 26 ++++++++++++++++++++++++++ README.adoc | 1 + 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/arduino-lint.yml diff --git a/.github/workflows/arduino-lint.yml b/.github/workflows/arduino-lint.yml new file mode 100644 index 0000000..4b3b6d5 --- /dev/null +++ b/.github/workflows/arduino-lint.yml @@ -0,0 +1,26 @@ +name: Arduino Lint +on: + push: + pull_request: + # Scheduled trigger checks for breakage caused by new rules added to Arduino Lint + schedule: + # run every Saturday at 3 AM UTC + - cron: "0 3 * * 6" + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_dispatch + workflow_dispatch: + # See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch + repository_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Arduino Lint + uses: arduino/arduino-lint-action@v1 + with: + official: true + library-manager: update diff --git a/README.adoc b/README.adoc index 0664572..182880a 100644 --- a/README.adoc +++ b/README.adoc @@ -5,6 +5,7 @@ = {repository-name} = image:https://github.com/{repository-owner}/{repository-name}/workflows/Compile%20Examples/badge.svg["Compile Examples Status", link="https://github.com/{repository-owner}/{repository-name}/actions?workflow=Compile+Examples"] +image:https://github.com/{repository-owner}/{repository-name}/workflows/Arduino%20Lint/badge.svg["Arduino Lint Status", link="https://github.com/{repository-owner}/{repository-name}/actions?workflow=Arduino+Lint"] image:https://github.com/{repository-owner}/{repository-name}/workflows/Spell%20Check/badge.svg["Spell Check Status", link="https://github.com/{repository-owner}/{repository-name}/actions?workflow=Spell+Check"] Arduino Library for the Atmel/Microchip ECC508 and ECC608 crypto chips