diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2021-07-02 14:49:57 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2021-07-02 14:49:57 +0300 |
commit | 98bb4fafffc2d6d5bc181c5e55140ac1d40b267c (patch) | |
tree | 449e90742ce4fa2657b1df2075cbd93313e24438 /.github/actions | |
parent | workflows/test: factor out steps + refactoring (diff) | |
download | setup-gcc-98bb4fafffc2d6d5bc181c5e55140ac1d40b267c.tar.gz setup-gcc-98bb4fafffc2d6d5bc181c5e55140ac1d40b267c.zip |
workflows/test: test multiple versions
Diffstat (limited to '')
-rw-r--r-- | .github/actions/check-cc/action.yml | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/.github/actions/check-cc/action.yml b/.github/actions/check-cc/action.yml index d2b98ed..945966f 100644 --- a/.github/actions/check-cc/action.yml +++ b/.github/actions/check-cc/action.yml @@ -1,16 +1,33 @@ name: Check cc/c++ description: Check cc/c++ +inputs: + version: + description: Specific version to check + required: false runs: using: composite steps: - # Is this really the most stable piece of `gcc --version` output? - run: | - echo (Get-Command cc).Path - $cc = & cc --version - echo $cc - $($cc | Select-String -Pattern "This is free software; see the source for copying conditions." -SimpleMatch -Quiet) -or $(throw "Unexpected `cc --version` output") - echo (Get-Command c++).Path - $cxx = & c++ --version - echo $cxx - $($cxx | Select-String -Pattern "This is free software; see the source for copying conditions." -SimpleMatch -Quiet) -or $(throw "Unexpected `c++ --version` output") + $version = '${{ inputs.version }}' + + function Check-Exe { + param( + [Parameter(Mandatory=$true)] + [string] $Exe + ) + + echo (Get-Command $Exe).Path + $output = & $Exe --version + echo $output + + # Is this really the most stable piece of `gcc --version` output? + $($output | Select-String -Pattern "This is free software; see the source for copying conditions." -SimpleMatch -Quiet) -or $(throw "Unexpected `$Exe --version` output") + + if ($script:version) { + $($output | Select-String -Pattern "$script:version." -SimpleMatch -Quiet) -or $(throw "Unexpected `$Exe --version` output") + } + } + + Check-Exe cc + Check-Exe c++ shell: pwsh |