File tree Expand file tree Collapse file tree 1 file changed +29
-5
lines changed
Expand file tree Collapse file tree 1 file changed +29
-5
lines changed Original file line number Diff line number Diff line change @@ -377,12 +377,36 @@ runs:
377377 ^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args
378378
379379 print $"\n(ansi purple)Ensuring clang-format and clang-tidy ${{ inputs.version }} are present(ansi reset)"
380- let tools = ['clang-format' 'clang-tidy']
380+ let version = "${{ inputs.version }}" | into int
381+
382+ $uv_args = [run --no-sync --project $action_path --directory (pwd)]
383+ if $verbosity {
384+ $uv_args = $uv_args | append '-v'
385+ }
386+
387+ mut tools = []
388+ if ("${{ inputs.tidy-checks }}" != "-*") {
389+ # clang-tidy is being used
390+ $tools = $tools | append "clang-tidy"
391+ }
392+ if ("${{ inputs.style }}" | is-not-empty) {
393+ # clang-format is being used
394+ $tools = $tools | append "clang-format"
395+ }
396+
381397 for tool in $tools {
382- let cmd = [clang-tools-wheel --tool $tool --version ${{ inputs.version }}]
383- $uv_args = [run --no-sync --project $action_path --directory (pwd)]
384- if $verbosity {
385- $uv_args = $uv_args | append '-v'
398+ print $"Installing ($tool) ($version)"
399+ let cmd = if (
400+ (($version < 13) and ($tool | str ends-with "tidy"))
401+ or (
402+ ($version <= 9)
403+ and ($tool | str ends-with "format")
404+ and not ((sys host | get 'long_os_version') | str starts-with "Linux")
405+ )
406+ ) {
407+ [clang-tools --tool $tool --install $version]
408+ } else {
409+ [clang-tools-wheel --tool $tool --version $version]
386410 }
387411 ^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args ...$cmd
388412 }
You can’t perform that action at this time.
0 commit comments