diff --git a/.github/actions/lint-cmake/action.yml b/.github/actions/lint-cmake/action.yml new file mode 100644 index 000000000..08a55d9a3 --- /dev/null +++ b/.github/actions/lint-cmake/action.yml @@ -0,0 +1,21 @@ +name: "Lint cmake" +description: "Lints cmake file" + +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 cmake_format + + - name: Linting with CMake formatter + uses: ./.github/actions/lint-error + with: + format-command: ./scripts/lint_cmake.py -f + format-tool: "cmake-format" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d08b189a0..be0d7f4cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,8 +83,15 @@ jobs: uses: ./.github/actions/test-summary lint-cmake: - if: ${{ github.event_name == 'pull_request' }} - uses: ./.github/workflows/lint-cmake.yml + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Lint Cmake + uses: ./.github/actions/lint-cmake lint-clang: if: ${{ github.event_name == 'pull_request' }} diff --git a/.github/workflows/lint-cmake.yml b/.github/workflows/lint-cmake.yml deleted file mode 100644 index e3288a5c6..000000000 --- a/.github/workflows/lint-cmake.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: "Lint CMake" - -on: - workflow_dispatch: - workflow_call: - -jobs: - lint-cmake: - 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 cmake_format - - - name: Linting with CMake formatter - id: lint-cmake - uses: ./.github/actions/lint-error - with: - format-command: ./scripts/lint_cmake.py -f - format-tool: "cmake-format"