aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/actions/check-lld/action.yml
blob: 1eea79473e969259d9d3b4ba7a218cdb6fff0ebf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Check LLD
description: Check LLD
inputs:
  version:
    description: Specific version to check
    required: false
runs:
  using: composite
  steps:
    - env:
        ARG_VERSION: ${{ inputs.version }}
      run: |
        function Check-Exe {
            param(
                [Parameter(Mandatory=$true)]
                [string] $Exe,
                [Parameter(Mandatory=$true)]
                [string] $HelpString
            )

            echo (Get-Command $Exe).Path
            $output = & $Exe --version 2>&1
            echo $output

            $($output | Select-String -Pattern $HelpString -SimpleMatch -Quiet) -or $(throw "Unexpected `$Exe --version` output")
        }

        $version = $env:ARG_VERSION

        $driver_exe = 'lld'
        # Although the output of `lld --version` claims that it's ld-link on
        # Windows, the Chocolatey version at least still uses ld.lld as on
        # Linux.
        $real_exe = 'ld.lld'

        if ($version) {
            $driver_exe = "$driver_exe-$version"
            $real_exe = "$real_exe-$version"
        }

        Check-Exe $driver_exe 'lld is a generic driver'
        Check-Exe $real_exe "LLD $version"
      shell: pwsh