blob: 8b4e109f606e85c332e2151c2abf2ccd9e15ac25 (
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
name: Check that Boost libraries were built
description: Check that Boost libraries were built
inputs:
boost_dir:
description: Boost directory
required: false
libraries:
description: Libraries to check
required: true
platform:
description: Target platform
required: false
default: x64
configuration:
description: Configuration to check
required: false
default: Debug
runs:
using: composite
steps:
- env:
ARG_BOOST_DIR: ${{ inputs.boost_dir }}
ARG_LIBRARIES: ${{ inputs.libraries }}
ARG_PLATFORM: ${{ inputs.platform }}
ARG_CONFIGURATION: ${{ inputs.configuration }}
run: |
$boost_dir = (Get-ChildItem env:ARG_BOOST_DIR).Value
if (-not $boost_dir) {
$boost_dir = (Get-ChildItem env:BOOST_DIR).Value
}
$libraries = (Get-ChildItem env:ARG_LIBRARIES).Value.Split(' ')
$platform = (Get-ChildItem env:ARG_PLATFORM).Value
$configuration = (Get-ChildItem env:ARG_CONFIGURATION).Value.ToLower()
$install_dir = Join-Path 'install_dir' $platform $configuration
$lib_dir = Join-Path $boost_dir $install_dir 'lib'
function Get-FileStubs {
param(
[Parameter(Mandatory=$true)]
[string] $lib
)
if ($lib -eq 'test') {
"prg_exec_monitor","test_exec_monitor","unit_test_framework"
} else {
@($lib)
}
}
$lib_prefix = (Get-ChildItem env:CI_LIB_PREFIX).Value
$lib_ext = (Get-ChildItem env:CI_LIB_EXT).Value
$files = @()
foreach ($lib in $libraries) {
$stubs = Get-FileStubs $lib
foreach ($stub in $stubs) {
$files += "${lib_prefix}boost_$stub$lib_ext"
}
}
$files = $files | Sort-Object
echo '----------------------------------------------------------------'
echo 'Expected files'
echo '----------------------------------------------------------------'
echo $files
echo ''
echo '----------------------------------------------------------------'
echo 'Actual files'
echo '----------------------------------------------------------------'
echo (Get-ChildItem $lib_dir | Sort-Object Name).Name
$missing = @()
foreach ($file in $files) {
if (!(Test-Path (Join-Path $lib_dir $file) -Type Leaf)) {
$missing += $file
}
}
if ($missing.Count -ne 0) {
throw "These libraries are missing: $($missing -join ', ')"
}
shell: pwsh
|