mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-04 10:33:30 +00:00
CI: Update clang-format version to 17.0.3
This commit is contained in:
parent
e0f0c1147a
commit
dd3255815c
8
.github/actions/run-clang-format/action.yaml
vendored
8
.github/actions/run-clang-format/action.yaml
vendored
|
@ -28,7 +28,7 @@ runs:
|
||||||
echo ::group::Install Dependencies
|
echo ::group::Install Dependencies
|
||||||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
|
||||||
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
|
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
|
||||||
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@16/bin" >> $GITHUB_PATH
|
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@17/bin" >> $GITHUB_PATH
|
||||||
brew install --quiet zsh
|
brew install --quiet zsh
|
||||||
echo ::endgroup::
|
echo ::endgroup::
|
||||||
|
|
||||||
|
@ -55,11 +55,11 @@ runs:
|
||||||
}
|
}
|
||||||
|
|
||||||
if (( ${changes[(I)(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)]} )) {
|
if (( ${changes[(I)(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)]} )) {
|
||||||
print ::group::Install clang-format-16
|
print ::group::Install clang-format-17
|
||||||
brew install --quiet obsproject/tools/clang-format@16
|
brew install --quiet obsproject/tools/clang-format@17
|
||||||
print ::endgroup::
|
print ::endgroup::
|
||||||
|
|
||||||
print ::group::Run clang-format-16
|
print ::group::Run clang-format-17
|
||||||
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${(M)changes:#(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)}
|
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${(M)changes:#(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)}
|
||||||
print ::endgroup::
|
print ::endgroup::
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,24 +33,24 @@ invoke_formatter() {
|
||||||
|
|
||||||
case ${formatter} {
|
case ${formatter} {
|
||||||
clang)
|
clang)
|
||||||
if (( ${+commands[clang-format-16]} )) {
|
if (( ${+commands[clang-format-17]} )) {
|
||||||
local formatter=clang-format-16
|
local formatter=clang-format-17
|
||||||
} elif (( ${+commands[clang-format]} )) {
|
} elif (( ${+commands[clang-format]} )) {
|
||||||
local formatter=clang-format
|
local formatter=clang-format
|
||||||
} else {
|
} else {
|
||||||
log_error "No viable clang-format version found (required 16.0.5)"
|
log_error "No viable clang-format version found (required 17.0.3)"
|
||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
local -a formatter_version=($(${formatter} --version))
|
local -a formatter_version=($(${formatter} --version))
|
||||||
|
|
||||||
if ! is-at-least 16.0.5 ${formatter_version[-1]}; then
|
if ! is-at-least 17.0.3 ${formatter_version[-1]}; then
|
||||||
log_error "clang-format is not version 16.0.5 or above (found ${formatter_version[-1]}."
|
log_error "clang-format is not version 17.0.3 or above (found ${formatter_version[-1]}."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! is-at-least ${formatter_version[-1]} 16.0.5; then
|
if ! is-at-least ${formatter_version[-1]} 17.0.3; then
|
||||||
log_error "clang-format is more recent than version 16.0.5 (found ${formatter_version[-1]})."
|
log_error "clang-format is more recent than version 17.0.3 (found ${formatter_version[-1]})."
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue