From 9141a1d1fa60dce63cf1a7eef37bb5fac372818f Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 26 May 2020 04:58:35 -0700 Subject: [PATCH] Use GitHub actions for continuous integration - On every pull request and push, compile appropriate examples for MKR1000, MKRGSM, Uno WiFi Rev2 - Comment on pull requests with a report of how the proposed changes affect memory usage - Check all files, except the external resource src/bearssl, for commonly misspelled words. In the event of false positives, add the word (in lower case) to extras/codespell-ignore-words-list.txt. --- .github/workflows/compile-examples.yml | 76 ++++++++++++++++++++++++ .github/workflows/report-size-deltas.yml | 14 +++++ .github/workflows/spell-check.yml | 17 ++++++ extras/codespell-ignore-words-list.txt | 0 4 files changed, 107 insertions(+) create mode 100644 .github/workflows/compile-examples.yml create mode 100644 .github/workflows/report-size-deltas.yml create mode 100644 .github/workflows/spell-check.yml create mode 100644 extras/codespell-ignore-words-list.txt diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml new file mode 100644 index 0000000..ad2cf32 --- /dev/null +++ b/.github/workflows/compile-examples.yml @@ -0,0 +1,76 @@ +name: Compile Examples + +on: + pull_request: + paths: + - .github/workflows/compile-examples.yml + - examples/** + - src/** + push: + paths: + - .github/workflows/compile-examples.yml + - examples/** + - src/** + +jobs: + build: + runs-on: ubuntu-latest + + env: + # libraries to install for all boards + UNIVERSAL_LIBRARIES: | + # install the ArduinoBearSSL library from the local path + - source-path: ./ + - name: ArduinoECCX08 + # sketch paths to compile (recursive) for all boards + UNIVERSAL_SKETCH_PATHS: '"examples/SHA1" "examples/SHA256"' + + strategy: + fail-fast: false + + matrix: + board: + - fqbn: arduino:samd:mkr1000 + type: wifi101 + - fqbn: arduino:samd:mkrgsm1400 + type: gsm + - fqbn: arduino:megaavr:uno2018 + type: megaavr + + # make board type-specific customizations to the matrix jobs + include: + # WiFi101-compatible boards + - board: + type: wifi101 + libraries: | + - name: WiFi101 + sketch-paths: '"examples/WiFiSSLClient"' + # GSM boards + - board: + type: gsm + libraries: | + - name: MKRGSM + sketch-paths: '"examples/MKRGSMSSLClient"' + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Compile examples + uses: per1234/actions/libraries/compile-examples@beaac5ae4bb7ab294f1305e436172fde4c281fc8 + with: + fqbn: ${{ matrix.board.fqbn }} + libraries: | + ${{ env.UNIVERSAL_LIBRARIES }} + ${{ matrix.libraries }} + sketch-paths: ${{ env.UNIVERSAL_SKETCH_PATHS }} ${{ matrix.sketch-paths }} + size-report-sketch: SHA256 + enable-size-deltas-report: true + verbose: true + + - 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 diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..fb75d80 --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,14 @@ +name: Report Size Deltas + +on: + schedule: + # schedule action for every five minutes (ends up being a little longer in practice) + - cron: "*/5 * * * *" + +jobs: + report: + runs-on: ubuntu-latest + + steps: + - name: Comment size deltas reports to PRs + uses: arduino/actions/libraries/report-size-deltas@master diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 0000000..fba93da --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -0,0 +1,17 @@ +name: Spell Check + +on: [push, pull_request] + +jobs: + spellcheck: + runs-on: ubuntu-latest + + steps: + - name: Checkout + 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 diff --git a/extras/codespell-ignore-words-list.txt b/extras/codespell-ignore-words-list.txt new file mode 100644 index 0000000..e69de29