From 7d564b3c5e1209a8358fd4fb0796eda06226c7db Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 20 Apr 2021 15:20:49 -0700 Subject: [PATCH] Update CI workflow for 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. This replaces the "Extra Library Checks" workflow in all but one respect: keywords.txt linting. Arduino Lint does not currently do any validation of the keywords.txt data, so use of the `per1234/arduino-ci-script` script is still required for this specific check. A dedicated "Check keywords.txt" workflow was added for that purpose. --- .github/workflows/check-arduino.yml | 26 +++++++ .github/workflows/check-keywords-txt.yml | 36 ++++++++++ .github/workflows/extra-library-checks.yml | 81 ---------------------- README.md | 3 +- 4 files changed, 64 insertions(+), 82 deletions(-) create mode 100644 .github/workflows/check-arduino.yml create mode 100644 .github/workflows/check-keywords-txt.yml delete mode 100644 .github/workflows/extra-library-checks.yml diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml new file mode 100644 index 0000000..b3d64e6 --- /dev/null +++ b/.github/workflows/check-arduino.yml @@ -0,0 +1,26 @@ +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@v2 + + - name: Arduino Lint + uses: arduino/arduino-lint-action@v1 + with: + compliance: specification + library-manager: update + project-type: library diff --git a/.github/workflows/check-keywords-txt.yml b/.github/workflows/check-keywords-txt.yml new file mode 100644 index 0000000..ff1595f --- /dev/null +++ b/.github/workflows/check-keywords-txt.yml @@ -0,0 +1,36 @@ +name: Check keywords.txt + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/check-keywords-txt.yml" + - "keywords.txt" + pull_request: + paths: + - ".github/workflows/check-keywords-txt.yml" + - "keywords.txt" + workflow_dispatch: + repository_dispatch: + +jobs: + extra-library-checks: + runs-on: ubuntu-latest + + env: + ARDUINO_CI_SCRIPT_FOLDER: extras/ci-tools/arduino-ci-script + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install arduino-ci-script + uses: per1234/install-arduino-ci-script-action@main + with: + installation-path: ${{ env.ARDUINO_CI_SCRIPT_FOLDER }} + + # See: https://github.com/per1234/arduino-ci-script#check_keywords_txt-searchpath-maximumsearchdepth + - name: Check keywords.txt + run: | + source "${ARDUINO_CI_SCRIPT_FOLDER}/arduino-ci-script.sh" + check_keywords_txt "$GITHUB_WORKSPACE" diff --git a/.github/workflows/extra-library-checks.yml b/.github/workflows/extra-library-checks.yml deleted file mode 100644 index ea196f6..0000000 --- a/.github/workflows/extra-library-checks.yml +++ /dev/null @@ -1,81 +0,0 @@ -name: Extra Library Checks - -on: - - pull_request - - push - -env: - ARDUINO_CI_SCRIPT_FOLDER: extras/ci-tools/arduino-ci-script - -jobs: - check-library-structure: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install arduino-ci-script - uses: per1234/install-arduino-ci-script-action@main - with: - installation-path: ${{ env.ARDUINO_CI_SCRIPT_FOLDER }} - - # See: https://github.com/per1234/arduino-ci-script#check_library_structure-basepath-depth - - name: Check library structure - run: | - source "${ARDUINO_CI_SCRIPT_FOLDER}/arduino-ci-script.sh" - check_library_structure "$GITHUB_WORKSPACE" - - check-library-properties: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install arduino-ci-script - uses: per1234/install-arduino-ci-script-action@main - with: - installation-path: ${{ env.ARDUINO_CI_SCRIPT_FOLDER }} - - # See: https://github.com/per1234/arduino-ci-script#check_library_properties-searchpath-maximumsearchdepth - - name: Check library.properties - run: | - source "${ARDUINO_CI_SCRIPT_FOLDER}/arduino-ci-script.sh" - check_library_properties "$GITHUB_WORKSPACE" - - check-keywords-txt: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install arduino-ci-script - uses: per1234/install-arduino-ci-script-action@main - with: - installation-path: ${{ env.ARDUINO_CI_SCRIPT_FOLDER }} - - # See: https://github.com/per1234/arduino-ci-script#check_keywords_txt-searchpath-maximumsearchdepth - - name: Check keywords.txt - run: | - source "${ARDUINO_CI_SCRIPT_FOLDER}/arduino-ci-script.sh" - check_keywords_txt "$GITHUB_WORKSPACE" - - check-library-manager-compliance: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Install arduino-ci-script - uses: per1234/install-arduino-ci-script-action@main - with: - installation-path: ${{ env.ARDUINO_CI_SCRIPT_FOLDER }} - - # See: https://github.com/per1234/arduino-ci-script#check_library_manager_compliance-librarypath - - name: Check Library Manager compliance - run: | - source "${ARDUINO_CI_SCRIPT_FOLDER}/arduino-ci-script.sh" - check_library_manager_compliance "$GITHUB_WORKSPACE" diff --git a/README.md b/README.md index 7754610..f512ab6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ ===================== [![Compile Examples](https://github.com/107-systems/107-Arduino-TMF8801/workflows/Compile%20Examples/badge.svg)](https://github.com/107-systems/107-Arduino-TMF8801/actions?workflow=Compile+Examples) -[![Extra Library Checks](https://github.com/107-systems/107-Arduino-TMF8801/workflows/Extra%20Library%20Checks/badge.svg)](https://github.com/107-systems/107-Arduino-TMF8801/actions?workflow=Extra+Library+Checks) +[![Check Arduino](https://github.com/107-systems/107-Arduino-TMF8801/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/107-systems/107-Arduino-TMF8801/actions/workflows/check-arduino.yml) +[![Check keywords.txt](https://github.com/107-systems/107-Arduino-TMF8801/actions/workflows/check-keywords-txt.yml/badge.svg)](https://github.com/107-systems/107-Arduino-TMF8801/actions/workflows/check-keywords-txt.yml) [![General Formatting Checks](https://github.com/107-systems/107-Arduino-TMF8801/workflows/General%20Formatting%20Checks/badge.svg)](https://github.com/107-systems/107-Arduino-TMF8801/actions?workflow=General+Formatting+Checks) [![Spell Check](https://github.com/107-systems/107-Arduino-TMF8801/workflows/Spell%20Check/badge.svg)](https://github.com/107-systems/107-Arduino-TMF8801/actions?workflow=Spell+Check)