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 @@ -378,12 +378,36 @@ 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 (
401+ (($version < 13) and ($tool | str ends-with "tidy"))
402+ or (
403+ ($version <= 9)
404+ and ($tool | str ends-with "format")
405+ and ((sys host | get 'long_os_version') | str starts-with "Linux")
406+ )
407+ ) {
408+ [clang-tools --tool $tool --install $version]
409+ } else {
410+ [clang-tools-wheel --tool $tool --version $version]
387411 }
388412 ^$'($env.UV_INSTALL_DIR)/uv' ...$uv_args ...$cmd
389413 }
You can’t perform that action at this time.
0 commit comments