From 6720edb2e46b1f846c0faccc4bac9bbb34956eb4 Mon Sep 17 00:00:00 2001 From: Xavier BRASSOUD Date: Fri, 16 Feb 2024 17:22:52 +0100 Subject: [PATCH] Add Arduino, C++ and PR title linters --- .github/workflows/lint_git.yml | 20 ++++++++++++++++++++ .github/workflows/quality.yml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/lint_git.yml create mode 100644 .github/workflows/quality.yml diff --git a/.github/workflows/lint_git.yml b/.github/workflows/lint_git.yml new file mode 100644 index 0000000..4dab2cd --- /dev/null +++ b/.github/workflows/lint_git.yml @@ -0,0 +1,20 @@ +name: "Lint PR" + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +permissions: + pull-requests: read + +jobs: + lint-git: + name: Validate PR title + runs-on: ubuntu-22.04 + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml new file mode 100644 index 0000000..1571d5d --- /dev/null +++ b/.github/workflows/quality.yml @@ -0,0 +1,31 @@ +--- +name: Quality Gates + +on: + push: + pull_request: + workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + path: + - 'src' + - 'examples' + steps: + - uses: actions/checkout@v4 + + - name: arduino-lint + uses: arduino/arduino-lint-action@v1 + with: + library-manager: update + compliance: strict + + - uses: cpp-linter/cpp-linter-action@v2 + with: + style: file + files-changed-only: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}