From 10873eddcd1db0711fbe1da3c35d211776f204cc Mon Sep 17 00:00:00 2001 From: sithlord48 Date: Sun, 13 Oct 2024 14:32:50 -0400 Subject: [PATCH] ci: lint-clang as composite action --- .github/actions/lint-clang/action.yml | 21 +++++++++++++++++++ .github/workflows/ci.yml | 11 ++++++++-- .github/workflows/lint-clang.yml | 29 --------------------------- 3 files changed, 30 insertions(+), 31 deletions(-) create mode 100644 .github/actions/lint-clang/action.yml delete mode 100644 .github/workflows/lint-clang.yml diff --git a/.github/actions/lint-clang/action.yml b/.github/actions/lint-clang/action.yml new file mode 100644 index 000000000..9bf9f4554 --- /dev/null +++ b/.github/actions/lint-clang/action.yml @@ -0,0 +1,21 @@ +name: "Lint clang" +description: "Clang Ling Sources" + +runs: + using: "composite" + + steps: + - name: Setup Python venv + uses: ./.github/actions/init-python + + - name: Install dependencies + shell: bash + run: | + source .venv/bin/activate + pip install pyyaml clang_format + + - name: Linting with CMake formatter + uses: ./.github/actions/lint-error + with: + format-command: ./scripts/lint_clang.py -f + format-tool: "cmake-format" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be0d7f4cf..8a497da58 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,8 +94,15 @@ jobs: uses: ./.github/actions/lint-cmake lint-clang: - if: ${{ github.event_name == 'pull_request' }} - uses: ./.github/workflows/lint-clang.yml + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Linting Clang + uses: ./.github/actions/lint-clang analyse-valgrind: needs: [lint-cmake, lint-clang] diff --git a/.github/workflows/lint-clang.yml b/.github/workflows/lint-clang.yml deleted file mode 100644 index 2e7a97f0c..000000000 --- a/.github/workflows/lint-clang.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: "Lint Clang" - -on: - workflow_dispatch: - workflow_call: - -jobs: - lint-clang: - runs-on: ubuntu-latest - timeout-minutes: 5 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Python venv - uses: ./.github/actions/init-python - - - name: Install dependencies - run: | - source .venv/bin/activate - pip install pyyaml clang_format - - - name: Linting with Clang format - id: lint-clang - uses: ./.github/actions/lint-error - with: - format-command: ./scripts/lint_clang.py -f - format-tool: "clang-format"