ci: lint-cmake as composite action
This commit is contained in:
parent
c498e148b8
commit
5b76982093
3 changed files with 30 additions and 31 deletions
21
.github/actions/lint-cmake/action.yml
vendored
Normal file
21
.github/actions/lint-cmake/action.yml
vendored
Normal file
|
|
@ -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"
|
||||||
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
|
|
@ -83,8 +83,15 @@ jobs:
|
||||||
uses: ./.github/actions/test-summary
|
uses: ./.github/actions/test-summary
|
||||||
|
|
||||||
lint-cmake:
|
lint-cmake:
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
runs-on: ubuntu-latest
|
||||||
uses: ./.github/workflows/lint-cmake.yml
|
timeout-minutes: 5
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Lint Cmake
|
||||||
|
uses: ./.github/actions/lint-cmake
|
||||||
|
|
||||||
lint-clang:
|
lint-clang:
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
|
|
||||||
29
.github/workflows/lint-cmake.yml
vendored
29
.github/workflows/lint-cmake.yml
vendored
|
|
@ -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"
|
|
||||||
Loading…
Reference in a new issue