Skip to content

Commit 9de4cf2

Browse files
shenxianpeng2bndy5
andauthored
Update action.yml
Co-authored-by: Brendan <2bndy5@gmail.com>
1 parent b1a59d8 commit 9de4cf2

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

action.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -378,12 +378,29 @@ runs:
378378
^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args
379379
380380
print $"\n(ansi purple)Ensuring clang-format and clang-tidy ${{ inputs.version }} are present(ansi reset)"
381-
let tools = ['clang-format' 'clang-tidy']
381+
let version = "${{ inputs.version }}" | into int
382+
383+
$uv_args = [run --no-sync --project $action_path --directory (pwd)]
384+
if $verbosity {
385+
$uv_args = $uv_args | append '-v'
386+
}
387+
388+
mut tools = []
389+
if ("${{ inputs.tidy-checks }}" != "-*") {
390+
# clang-tidy is being used
391+
$tools = $tools | append "clang-tidy"
392+
}
393+
if ("${{ inputs.style }}" | is-not-empty) {
394+
# clang-format is being used
395+
$tools = $tools | append "clang-format"
396+
}
397+
382398
for tool in $tools {
383-
let cmd = [clang-tools-wheel --tool $tool --version ${{ inputs.version }}]
384-
$uv_args = [run --no-sync --project $action_path --directory (pwd)]
385-
if $verbosity {
386-
$uv_args = $uv_args | append '-v'
399+
print $"Installing ($tool) ($version)"
400+
let cmd = if ($version < 13) and ($tool | str ends-with "tidy") {
401+
[clang-tools --tool $tool --install $version]
402+
} else {
403+
[clang-tools-wheel --tool $tool --version $version]
387404
}
388405
^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args ...$cmd
389406
}

0 commit comments

Comments
 (0)