зеркало из https://github.com/mozilla/cubeb.git
Allow specifying a particular clang-format binary (version), and pin the CI to version 15
This commit is contained in:
Родитель
febf49d089
Коммит
5e12bb870d
|
@ -74,15 +74,18 @@ jobs:
|
|||
run: cmake --build build
|
||||
|
||||
check_format:
|
||||
runs-on: ubuntu-20.04
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: true
|
||||
|
||||
- name: Install Dependencies (Linux)
|
||||
run: sudo apt-get update && sudo apt-get install clang-format-15
|
||||
|
||||
- name: Configure CMake
|
||||
shell: bash
|
||||
run: cmake -S . -B build
|
||||
run: cmake -S . -B build -DCLANG_FORMAT_BINARY=clang-format-15
|
||||
|
||||
- name: Check format
|
||||
shell: bash
|
||||
|
|
|
@ -427,6 +427,10 @@ if(BUILD_TOOLS)
|
|||
install(TARGETS cubeb-test)
|
||||
endif()
|
||||
|
||||
if(NOT CLANG_FORMAT_BINARY)
|
||||
set(CLANG_FORMAT_BINARY clang-format)
|
||||
endif()
|
||||
|
||||
add_custom_target(clang-format-check
|
||||
find
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/src
|
||||
|
@ -434,7 +438,7 @@ add_custom_target(clang-format-check
|
|||
-type f (-name "*.cpp" -o -name "*.c" -o -name "*.h")
|
||||
-not -path "*/subprojects/speex/*"
|
||||
-print0
|
||||
| xargs -0 clang-format -Werror -n
|
||||
| xargs -0 ${CLANG_FORMAT_BINARY} -Werror -n
|
||||
COMMENT "Check formatting with clang-format"
|
||||
VERBATIM)
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче