ci: lint-clang as composite action
This commit is contained in:
21
.github/actions/lint-clang/action.yml
vendored
Normal file
21
.github/actions/lint-clang/action.yml
vendored
Normal file
@ -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"
|
||||
11
.github/workflows/ci.yml
vendored
11
.github/workflows/ci.yml
vendored
@ -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]
|
||||
|
||||
29
.github/workflows/lint-clang.yml
vendored
29
.github/workflows/lint-clang.yml
vendored
@ -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"
|
||||
Reference in New Issue
Block a user