From 883e56d254e86f3485aee0d1ee28e0a17c5907a5 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 17 Apr 2021 19:03:10 +0300 Subject: workflows/test: factor out a common step --- .github/actions/check-libraries/action.yml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/actions/check-libraries/action.yml (limited to '.github/actions/check-libraries') diff --git a/.github/actions/check-libraries/action.yml b/.github/actions/check-libraries/action.yml new file mode 100644 index 0000000..8ef7c77 --- /dev/null +++ b/.github/actions/check-libraries/action.yml @@ -0,0 +1,38 @@ +name: Check that Boost libraries were built +description: Check that Boost libraries were built +inputs: + librarydir: + description: Directory with the library files + required: true + libraries: + description: Libraries to check + required: true + toolset: + description: Toolset used + required: false + default: auto +runs: + using: composite + steps: + - run: | + New-Variable os -Value '${{ runner.os }}' -Option Constant + New-Variable windows_host -Value ($os -eq 'Windows') -Option Constant + + New-Variable librarydir -Value '${{ inputs.librarydir }}' -Option Constant + New-Variable toolset -Value '${{ inputs.toolset }}' -Option Constant + + $prefix = 'libboost_' + $ext = '.a' + if ($windows_host -and $toolset -in @('auto', 'clang', 'msvc')) { + $ext = '.lib' + } + + $expected = '${{ inputs.libraries }}' + $expected = $expected.Split(' ', [System.StringSplitOptions]::RemoveEmptyEntries) + $expected = $expected | %{"$prefix$_$ext"} + + foreach ($lib in $expected) { + $path = Join-Path $librarydir $lib + $(Test-Path $path -Type Leaf) -or $(throw "Couldn't find Boost library at: $path") + } + shell: pwsh -- cgit v1.2.3