From 1623755904e81e80a72f0ac47e8d49ddfbf8ed73 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 4 Feb 2021 01:46:34 -0800 Subject: [PATCH 1/8] Use official codespell action for spell check CI The arduino/actions/libraries/spell-check action previously in use is deprecated. 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 | 7 +++++++ .github/workflows/spell-check.yml | 17 +++++++++++------ extras/codespell-ignore-words-list.txt | 0 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 .codespellrc delete mode 100644 extras/codespell-ignore-words-list.txt diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..1629857 --- /dev/null +++ b/.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 = , +check-filenames = +check-hidden = +skip = ./.git,./extras/TrustAnchors,./src/bearssl diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml index fba93da..01bee87 100644 --- a/.github/workflows/spell-check.yml +++ b/.github/workflows/spell-check.yml @@ -1,17 +1,22 @@ name: Spell Check -on: [push, pull_request] +# 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 + - name: Checkout repository uses: actions/checkout@v2 - name: Spell check - uses: arduino/actions/libraries/spell-check@master - with: - ignore-words-list: extras/codespell-ignore-words-list.txt - skip-paths: ./extras/TrustAnchors,./src/bearssl + uses: codespell-project/actions-codespell@master diff --git a/extras/codespell-ignore-words-list.txt b/extras/codespell-ignore-words-list.txt deleted file mode 100644 index e69de29..0000000 From b5e55dd786500591d3cb6faa8ca1775e8488a088 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 4 Feb 2021 01:48:11 -0800 Subject: [PATCH 2/8] Add additional trigger events to "Compile Examples" CI workflow The following additional events now trigger the workflow: - Weekly scheduled trigger. This would catch breakage caused by the external library and platform dependencies. - Trigger via the GitHub web interface. - Trigger via the GitHub API. --- .github/workflows/compile-examples.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index ad2cf32..934ea38 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -1,5 +1,6 @@ name: Compile Examples +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows on: pull_request: paths: @@ -11,6 +12,11 @@ on: - .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: From 95feac73ce5bf1016204acb4169179aa3191b769 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 4 Feb 2021 01:51:36 -0800 Subject: [PATCH 3/8] Use official repository for sketch compilation CI action The official dedicated repository for the Arduino sketch compilation GitHub Actions action is now arduino/compile-sketches. Since the time the action was moved, there was a breaking change to the default sketches report file name. Rather than continuing to rely on the default value, a specific file name is now defined in the workflow. --- .github/workflows/compile-examples.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 934ea38..2ab63ae 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -30,6 +30,7 @@ jobs: - name: ArduinoECCX08 # sketch paths to compile (recursive) for all boards UNIVERSAL_SKETCH_PATHS: '"examples/SHA1" "examples/SHA256"' + SKETCHES_REPORTS_PATH: sketches-reports strategy: fail-fast: false @@ -63,7 +64,7 @@ jobs: uses: actions/checkout@v2 - name: Compile examples - uses: per1234/actions/libraries/compile-examples@beaac5ae4bb7ab294f1305e436172fde4c281fc8 + uses: arduino/compile-sketches@main with: fqbn: ${{ matrix.board.fqbn }} libraries: | @@ -73,10 +74,11 @@ jobs: size-report-sketch: SHA256 enable-size-deltas-report: true verbose: true + sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} - name: Save sketches report as artifact if: github.event_name == 'pull_request' uses: actions/upload-artifact@v2 with: - name: size-deltas-reports - path: size-deltas-reports + path: ${{ env.SKETCHES_REPORTS_PATH }} + name: ${{ env.SKETCHES_REPORTS_PATH }} From 59ef78f0aca5affa9dfedd264d494e2a07f64fd5 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 4 Feb 2021 01:54:21 -0800 Subject: [PATCH 4/8] Use modern API of arduino/compile-sketches CI action The API of the arduino/compile-sketches GitHub Actions action has evolved since the time this repository's CI was set up. Although backwards compatibility with the previous API was retained, its use is deprecated and results in potentially confusing warnings. --- .github/workflows/compile-examples.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 2ab63ae..914b3ac 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -29,7 +29,9 @@ jobs: - source-path: ./ - name: ArduinoECCX08 # sketch paths to compile (recursive) for all boards - UNIVERSAL_SKETCH_PATHS: '"examples/SHA1" "examples/SHA256"' + UNIVERSAL_SKETCH_PATHS: | + - examples/SHA1 + - examples/SHA256 SKETCHES_REPORTS_PATH: sketches-reports strategy: @@ -51,13 +53,15 @@ jobs: type: wifi101 libraries: | - name: WiFi101 - sketch-paths: '"examples/WiFiSSLClient"' + sketch-paths: | + - examples/WiFiSSLClient # GSM boards - board: type: gsm libraries: | - name: MKRGSM - sketch-paths: '"examples/MKRGSMSSLClient"' + sketch-paths: | + - examples/MKRGSMSSLClient steps: - name: Checkout @@ -70,10 +74,11 @@ jobs: libraries: | ${{ env.UNIVERSAL_LIBRARIES }} ${{ matrix.libraries }} - sketch-paths: ${{ env.UNIVERSAL_SKETCH_PATHS }} ${{ matrix.sketch-paths }} - size-report-sketch: SHA256 - enable-size-deltas-report: true + sketch-paths: | + ${{ env.UNIVERSAL_SKETCH_PATHS }} + ${{ matrix.sketch-paths }} verbose: true + enable-deltas-report: true sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} - name: Save sketches report as artifact From f08ab298957d23a4a14e507d70036cf79014014a Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 4 Feb 2021 01:56:15 -0800 Subject: [PATCH 5/8] Configure arduino/compile-sketches CI action to do authenticated API requests The arduino/compile-sketches GitHub Actions action needs to do a GitHub API request to determine the base branch of a PR for the deltas determination. If a token is not defined via the action's `github-token` input, it does an unauthenticated API request, which is subject to more strict rate limiting policy. Although its unlikely for the number of API requests to exceed the unauthentticated allowance, use of a token ensures it will never happen. GitHub Actions provides a token for this purpose, so there is no need to set up a custom one. --- .github/workflows/compile-examples.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index 914b3ac..c66e6d5 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -70,6 +70,7 @@ jobs: - name: Compile examples uses: arduino/compile-sketches@main with: + github-token: ${{ secrets.GITHUB_TOKEN }} fqbn: ${{ matrix.board.fqbn }} libraries: | ${{ env.UNIVERSAL_LIBRARIES }} From f5b6f5063bcf77ce59a3b90c1f3cc90eafbacddf Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 4 Feb 2021 02:01:24 -0800 Subject: [PATCH 6/8] Add additional trigger events to "Report Size Deltas" CI workflow The following additional events now trigger the workflow: - Pushed commit that modifys the action's workflow. This is useful for verifying that the change was correct. - Trigger via the GitHub web interface. - Trigger via the GitHub API. --- .github/workflows/report-size-deltas.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml index fb75d80..2bdccf1 100644 --- a/.github/workflows/report-size-deltas.yml +++ b/.github/workflows/report-size-deltas.yml @@ -1,9 +1,17 @@ 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: - # schedule action for every five minutes (ends up being a little longer in practice) + # 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: From 6aac9441f5518584883c59dcbee821125fcd434d Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 4 Feb 2021 02:03:57 -0800 Subject: [PATCH 7/8] Use deltas report CI action from the dedicated repository Since the time the CI system for this repository was set up, Arduino's sketch compilation GitHub Actions actions have been moved to dedicated repositories and the copies left behind in the experimental arduino/actions repository deprecated. --- .github/workflows/report-size-deltas.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml index 2bdccf1..22ede4a 100644 --- a/.github/workflows/report-size-deltas.yml +++ b/.github/workflows/report-size-deltas.yml @@ -19,4 +19,4 @@ jobs: steps: - name: Comment size deltas reports to PRs - uses: arduino/actions/libraries/report-size-deltas@master + uses: arduino/report-size-deltas@main From 5ddf74e7475f2a65f9a7a8b00a2767e271436c1e Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 4 Feb 2021 02:05:48 -0800 Subject: [PATCH 8/8] Specify sketches report artifact name in "Report Size Deltas" CI workflow Even though the default artifact name is in use, reliance on this default is perhaps a bit more prone to issues. --- .github/workflows/report-size-deltas.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml index 22ede4a..944d92c 100644 --- a/.github/workflows/report-size-deltas.yml +++ b/.github/workflows/report-size-deltas.yml @@ -20,3 +20,6 @@ jobs: steps: - name: Comment size deltas reports to PRs uses: arduino/report-size-deltas@main + with: + # The name of the workflow artifact created by the sketch compilation workflow + sketches-reports-source: sketches-reports