diff options
| author | Egor Tensin <egor@tensin.name> | 2026-10-19 04:48:26 +0300 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-10-19 05:23:15 +0300 |
| commit | b1bfbd3501b6521d3204b5d060f88a8f6153f945 (patch) | |
| tree | bf2d3869023e1dd20bf395d5dca52f4b6b2b4f39 | |
| parent | workflows/lint: add a zizmor job (diff) | |
| download | cmake-common-b1bfbd3501b6521d3204b5d060f88a8f6153f945.tar.gz cmake-common-b1bfbd3501b6521d3204b5d060f88a8f6153f945.zip | |
{actions,workflows}: fail on unset environment variables
The $env:NAME syntax fails to produce an error if $NAME is not defined,
regardless of Set-StrictMode/Set-PSDebug.
Also, while I'm at it, clean up the actions/workflows code a little bit.
Diffstat (limited to '')
| -rw-r--r-- | .github/actions/build-boost/action.yml | 24 | ||||
| -rw-r--r-- | .github/actions/build-example/action.yml | 47 | ||||
| -rw-r--r-- | .github/actions/check-arch/action.yml | 19 | ||||
| -rw-r--r-- | .github/actions/check-boost-bootstrapped/action.yml | 17 | ||||
| -rw-r--r-- | .github/actions/check-boost-download/action.yml | 4 | ||||
| -rw-r--r-- | .github/actions/check-boost-libraries/action.yml | 27 | ||||
| -rw-r--r-- | .github/actions/check-runtime-library/action.yml | 25 | ||||
| -rw-r--r-- | .github/actions/check-symbols/action.yml | 24 | ||||
| -rw-r--r-- | .github/actions/common-variables/action.yml | 2 | ||||
| -rw-r--r-- | .github/actions/download-boost/action.yml | 38 | ||||
| -rw-r--r-- | .github/actions/run-example-boost/action.yml | 16 | ||||
| -rw-r--r-- | .github/actions/run-example/action.yml | 21 | ||||
| -rw-r--r-- | .github/actions/software-environment/action.yml | 2 | ||||
| -rw-r--r-- | .github/workflows/boost_toolsets.yml | 21 | ||||
| -rw-r--r-- | .github/workflows/example_toolsets.yml | 21 | ||||
| -rw-r--r-- | .github/workflows/msvc_versions.yml | 21 |
16 files changed, 159 insertions, 170 deletions
diff --git a/.github/actions/build-boost/action.yml b/.github/actions/build-boost/action.yml index 2c6f446..4b0b5ad 100644 --- a/.github/actions/build-boost/action.yml +++ b/.github/actions/build-boost/action.yml @@ -1,7 +1,7 @@ name: Build Boost description: Build Boost inputs: - boost-dir: + boost_dir: description: Boost directory required: false toolset: @@ -23,30 +23,30 @@ runs: using: composite steps: - env: - ARG_BOOST_DIR: ${{ inputs.boost-dir }} + ARG_BOOST_DIR: ${{ inputs.boost_dir }} ARG_LIBRARIES: ${{ inputs.libraries }} ARG_TOOLSET: ${{ inputs.toolset }} ARG_PLATFORM: ${{ inputs.platform }} ARG_CONFIGURATION: ${{ inputs.configuration }} run: | - $python = 'python' - - $boost_dir = $env:ARG_BOOST_DIR + $boost_dir = (Get-ChildItem env:ARG_BOOST_DIR).Value if (-not $boost_dir) { - $boost_dir = $env:BOOST_DIR + $boost_dir = (Get-ChildItem env:BOOST_DIR).Value } - - $libraries = $env:ARG_LIBRARIES + $libraries = (Get-ChildItem env:ARG_LIBRARIES).Value $libraries = $libraries.Split(' ') if (-not $libraries) { Remove-Variable libraries } + $toolset = (Get-ChildItem env:ARG_TOOLSET).Value + $platform = (Get-ChildItem env:ARG_PLATFORM).Value + $configuration = (Get-ChildItem env:ARG_CONFIGURATION).Value - & $python ` + & python ` -m project.boost.build ` - --toolset $env:ARG_TOOLSET ` - --platform $env:ARG_PLATFORM ` - --configuration $env:ARG_CONFIGURATION ` + --toolset $toolset ` + --platform $platform ` + --configuration $configuration ` -- ` $boost_dir ` $libraries diff --git a/.github/actions/build-example/action.yml b/.github/actions/build-example/action.yml index cd49c28..7e97871 100644 --- a/.github/actions/build-example/action.yml +++ b/.github/actions/build-example/action.yml @@ -1,10 +1,10 @@ name: Build example project description: Build example project inputs: - src-dir: + src_dir: description: Project directory required: true - boost-dir: + boost_dir: description: Boost directory required: false toolset: @@ -20,43 +20,42 @@ inputs: required: false default: Debug outputs: - install-dir: + install_dir: description: Installation directory - value: ${{ steps.install-dir.outputs.path }} + value: ${{ steps.install_dir.outputs.path }} runs: using: composite steps: - - id: install-dir + - id: install_dir env: - ARG_SRC_DIR: ${{ inputs.src-dir }} + ARG_SRC_DIR: ${{ inputs.src_dir }} run: | - $src_dir = Resolve-Path $env:ARG_SRC_DIR + $workspace = (Get-ChildItem env:GITHUB_WORKSPACE).Value + $src_dir = Resolve-Path (Get-ChildItem env:ARG_SRC_DIR).Value $project_name = Split-Path $src_dir -Leaf - $install_dir = Join-Path (Split-Path $env:GITHUB_WORKSPACE) "install_$project_name" + $install_dir = Join-Path (Split-Path $workspace) "install_$project_name" echo "path=$install_dir" >> $env:GITHUB_OUTPUT shell: pwsh - env: - ARG_SRC_DIR: ${{ inputs.src-dir }} - ARG_BOOST_DIR: ${{ inputs.boost-dir }} + ARG_SRC_DIR: ${{ inputs.src_dir }} + ARG_BOOST_DIR: ${{ inputs.boost_dir }} ARG_TOOLSET: ${{ inputs.toolset }} ARG_PLATFORM: ${{ inputs.platform }} ARG_CONFIGURATION: ${{ inputs.configuration }} - INSTALL_DIR: ${{ steps.install-dir.outputs.path }} + INSTALL_DIR: ${{ steps.install_dir.outputs.path }} run: | - $python = 'python' - $src_dir = $env:ARG_SRC_DIR - $install_dir = $env:INSTALL_DIR - $boost_dir = $env:ARG_BOOST_DIR + $src_dir = (Get-ChildItem env:ARG_SRC_DIR).Value + $boost_dir = (Get-ChildItem env:ARG_BOOST_DIR).Value + $install_dir = (Get-ChildItem env:INSTALL_DIR).Value + $toolset = (Get-ChildItem env:ARG_TOOLSET).Value + $platform = (Get-ChildItem env:ARG_PLATFORM).Value + $configuration = (Get-ChildItem env:ARG_CONFIGURATION).Value $args = @( - '--install', - $install_dir, - '--platform', - $env:ARG_PLATFORM, - '--configuration', - $env:ARG_CONFIGURATION, - '--toolset', - $env:ARG_TOOLSET + '--install', $install_dir, + '--toolset', $toolset, + '--platform', $platform, + '--configuration', $configuration ) if ($boost_dir) { @@ -65,5 +64,5 @@ runs: $args += '--',$src_dir $env:VERBOSE = 1 - & $python -m project.build $args + & python -m project.build $args shell: pwsh diff --git a/.github/actions/check-arch/action.yml b/.github/actions/check-arch/action.yml index 3dce1d1..dca80f8 100644 --- a/.github/actions/check-arch/action.yml +++ b/.github/actions/check-arch/action.yml @@ -1,7 +1,7 @@ name: Verify architecture description: Verify target architecture inputs: - path: + install_dir: description: Installation directory required: true expected: @@ -11,16 +11,21 @@ runs: using: composite steps: - env: - ARG_PATH: ${{ inputs.path }} + ARG_INSTALL_DIR: ${{ inputs.install_dir }} ARG_EXPECTED: ${{ inputs.expected }} run: | - $script_path = if ($env:CI_TARGET_PE) { - Join-Path $env:GITHUB_WORKSPACE 'test' 'scripts' 'verify_arch.ps1' + $workspace = (Get-ChildItem env:GITHUB_WORKSPACE).Value + $install_dir = (Get-ChildItem env:ARG_INSTALL_DIR).Value + $expected = (Get-ChildItem env:ARG_EXPECTED).Value + + $script_path = if ((Get-ChildItem env:CI_TARGET_PE).Value) { + Join-Path $workspace 'test' 'scripts' 'verify_arch.ps1' } else { - Join-Path $env:GITHUB_WORKSPACE 'test' 'scripts' 'verify_arch.sh' + Join-Path $workspace 'test' 'scripts' 'verify_arch.sh' } - $exe_path = (Join-Path $env:ARG_PATH 'bin' 'foo') + $env:CI_EXE_EXT + $name = 'foo' + (Get-ChildItem env:CI_EXE_EXT).Value + $path = Join-Path $install_dir 'bin' $name - & $script_path $exe_path $env:ARG_EXPECTED + & $script_path $path $expected shell: pwsh diff --git a/.github/actions/check-boost-bootstrapped/action.yml b/.github/actions/check-boost-bootstrapped/action.yml index fa96575..91b1ff6 100644 --- a/.github/actions/check-boost-bootstrapped/action.yml +++ b/.github/actions/check-boost-bootstrapped/action.yml @@ -7,7 +7,7 @@ runs: echo '----------------------------------------------------------------' echo 'bootstrap.log' echo '----------------------------------------------------------------' - $path = Join-Path $env:BOOST_DIR 'bootstrap.log' + $path = Join-Path (Get-ChildItem env:BOOST_DIR).Value 'bootstrap.log' if (Test-Path $path -Type Leaf) { cat $path } @@ -17,7 +17,7 @@ runs: echo '----------------------------------------------------------------' echo 'project-config.jam' echo '----------------------------------------------------------------' - $path = Join-Path $env:BOOST_DIR 'project-config.jam' + $path = Join-Path (Get-ChildItem env:BOOST_DIR).Value 'project-config.jam' if (Test-Path $path -Type Leaf) { cat $path } @@ -28,17 +28,12 @@ runs: echo 'Checking that b2 executable was built' echo '----------------------------------------------------------------' $name = 'b2' - $path = Join-Path $env:BOOST_DIR $name - - $exists_plain = Test-Path $path -Type Leaf - $exists_exe = Test-Path "${path}.exe" -Type Leaf - $exists = if ($env:CI_HOST_WINDOWS) { - $exists_exe - } else { - $exists_plain + if ((Get-ChildItem env:CI_HOST_WINDOWS).Value) { + $name += '.exe' } + $path = Join-Path (Get-ChildItem env:BOOST_DIR).Value $name - if (-not $exists) { + if (!(Test-Path $path -Type Leaf)) { throw "b2 executable wasn't found" } shell: pwsh diff --git a/.github/actions/check-boost-download/action.yml b/.github/actions/check-boost-download/action.yml index a7c8e6b..85fde6c 100644 --- a/.github/actions/check-boost-download/action.yml +++ b/.github/actions/check-boost-download/action.yml @@ -9,9 +9,7 @@ runs: echo 'Checking that config.hpp exists' echo '----------------------------------------------------------------' $name = 'config.hpp' - $path = Join-Path $env:BOOST_DIR 'boost' $name - - $exists = Test-Path $path -Type Leaf + $path = Join-Path (Get-ChildItem env:BOOST_DIR).Value 'boost' $name if (!(Test-Path $path -Type Leaf)) { throw "$name wasn't found" diff --git a/.github/actions/check-boost-libraries/action.yml b/.github/actions/check-boost-libraries/action.yml index 58d9f49..8b4e109 100644 --- a/.github/actions/check-boost-libraries/action.yml +++ b/.github/actions/check-boost-libraries/action.yml @@ -1,7 +1,7 @@ name: Check that Boost libraries were built description: Check that Boost libraries were built inputs: - boost-dir: + boost_dir: description: Boost directory required: false libraries: @@ -19,21 +19,21 @@ runs: using: composite steps: - env: - ARG_BOOST_DIR: ${{ inputs.boost-dir }} + ARG_BOOST_DIR: ${{ inputs.boost_dir }} ARG_LIBRARIES: ${{ inputs.libraries }} ARG_PLATFORM: ${{ inputs.platform }} ARG_CONFIGURATION: ${{ inputs.configuration }} run: | - $boost_dir = $env:ARG_BOOST_DIR + $boost_dir = (Get-ChildItem env:ARG_BOOST_DIR).Value if (-not $boost_dir) { - $boost_dir = $env: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() - $libraries = $env:ARG_LIBRARIES.Split(' ') - $configuration = $env:ARG_CONFIGURATION.ToLower() - - $installdir = Join-Path 'install_dir' $env:ARG_PLATFORM $configuration - $librarydir = Join-Path $boost_dir $installdir 'lib' + $install_dir = Join-Path 'install_dir' $platform $configuration + $lib_dir = Join-Path $boost_dir $install_dir 'lib' function Get-FileStubs { param( @@ -48,11 +48,14 @@ runs: } } + $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 += "${env:CI_LIB_PREFIX}boost_$stub${env:CI_LIB_EXT}" + $files += "${lib_prefix}boost_$stub$lib_ext" } } $files = $files | Sort-Object @@ -66,12 +69,12 @@ runs: echo '----------------------------------------------------------------' echo 'Actual files' echo '----------------------------------------------------------------' - echo (Get-ChildItem $librarydir | Sort-Object Name).Name + echo (Get-ChildItem $lib_dir | Sort-Object Name).Name $missing = @() foreach ($file in $files) { - if (!(Test-Path (Join-Path $librarydir $file) -Type Leaf)) { + if (!(Test-Path (Join-Path $lib_dir $file) -Type Leaf)) { $missing += $file } } diff --git a/.github/actions/check-runtime-library/action.yml b/.github/actions/check-runtime-library/action.yml index be4823d..bedebb5 100644 --- a/.github/actions/check-runtime-library/action.yml +++ b/.github/actions/check-runtime-library/action.yml @@ -1,16 +1,16 @@ name: Verify runtime library linkage description: Verify runtime library linkage (static or shared) inputs: - path: + install_dir: description: Installation directory required: true runs: using: composite steps: - env: - ARG_PATH: ${{ inputs.path }} + ARG_INSTALL_DIR: ${{ inputs.install_dir }} run: | - $path = $env:ARG_PATH + $install_dir = (Get-ChildItem env:ARG_INSTALL_DIR).Value function Parse-DllLine { param( @@ -87,14 +87,14 @@ runs: ) $objdump = 'objdump' - if ($env:CI_HOST_WINDOWS) { + if ((Get-ChildItem env:CI_HOST_WINDOWS).Value) { $objdump = Get-Objdump } - if ($env:CI_TARGET_PE) { + if ((Get-ChildItem env:CI_TARGET_PE).Value) { & $objdump -x $ExePath | Parse-PeHeaders | echo } - if ($env:CI_TARGET_ELF) { + if ((Get-ChildItem env:CI_TARGET_ELF).Value) { & $objdump -x $ExePath | Parse-ElfHeaders | echo } } @@ -127,18 +127,18 @@ runs: ) $windows_forbidden = @('msvcrt.dll') - if ($env:CI_MINGW) { - if (!$env:CI_HOST_WINDOWS) { + if ((Get-ChildItem env:CI_MINGW).Value) { + if (!(Get-ChildItem env:CI_HOST_WINDOWS).Value) { $windows_forbidden = @() } } $linux_forbidden = @() - if ($env:CI_TARGET_WINDOWS) { + if ((Get-ChildItem env:CI_TARGET_WINDOWS).Value) { Do-ValidateLinkedLibraries ` -Actual $Actual ` -Forbidden $windows_forbidden - } elseif ($env:CI_TARGET_LINUX) { + } elseif ((Get-ChildItem env:CI_TARGET_LINUX).Value) { Do-ValidateLinkedLibraries ` -Actual $Actual ` -Forbidden $linux_forbidden @@ -147,7 +147,8 @@ runs: } } - $exe_path = (Join-Path $path 'bin' 'foo') + $env:CI_EXE_EXT - $libraries = Get-LinkedLibraries $exe_path + $name = 'foo' + (Get-ChildItem env:CI_EXE_EXT).Value + $path = Join-Path $install_dir 'bin' $name + $libraries = Get-LinkedLibraries $path Validate-LinkedLibraries $libraries shell: pwsh diff --git a/.github/actions/check-symbols/action.yml b/.github/actions/check-symbols/action.yml index 50a6843..abefda9 100644 --- a/.github/actions/check-symbols/action.yml +++ b/.github/actions/check-symbols/action.yml @@ -1,7 +1,7 @@ name: Check symbols description: Check debug symbols inputs: - path: + install_dir: description: Installation directory required: true expected: @@ -11,31 +11,37 @@ runs: using: composite steps: - env: - ARG_PATH: ${{ inputs.path }} + ARG_INSTALL_DIR: ${{ inputs.install_dir }} ARG_EXPECTED: ${{ inputs.expected }} run: | - $install_dir = $env:ARG_PATH + $workspace = (Get-ChildItem env:GITHUB_WORKSPACE).Value + $install_dir = (Get-ChildItem env:ARG_INSTALL_DIR).Value + $expected = (Get-ChildItem env:ARG_EXPECTED).Value + $bin_dir = Join-Path $install_dir 'bin' $lib_dir = Join-Path $install_dir 'lib' - $script_path = if ($env:CI_TARGET_ELF) { - Join-Path $env:GITHUB_WORKSPACE 'test' 'scripts' 'verify_symbols.sh' + $script_path = if ((Get-ChildItem env:CI_TARGET_ELF).Value) { + Join-Path $workspace 'test' 'scripts' 'verify_symbols.sh' } else { throw "Verifying symbols for PE executables is not implemented" } - ConvertFrom-Json $env:ARG_EXPECTED | %{ + ConvertFrom-Json $expected | %{ $target = $_.target $type = $_.type switch -Exact ($type) { 'exe' { - $file = $target + $env:CI_EXE_EXT + $ext = (Get-ChildItem env:CI_EXT_EXT).Value + $file = $target + $ext $path = Join-Path $bin_dir $file } 'dll' { - $file = $env:CI_DLL_PREFIX + $target + $env:CI_DLL_EXT - $path = if ($env:CI_DLL_IN_BIN) { + $prefix = (Get-ChildItem env:CI_DLL_PREFIX).Value + $ext = (Get-ChildItem env:CI_DLL_EXT).Value + $file = $prefix + $target + $ext + $path = if ((Get-ChildItem env:CI_DLL_IN_BIN).Value) { Join-Path $bin_dir $file } else { Join-Path $lib_dir $file diff --git a/.github/actions/common-variables/action.yml b/.github/actions/common-variables/action.yml index af86aff..249feae 100644 --- a/.github/actions/common-variables/action.yml +++ b/.github/actions/common-variables/action.yml @@ -10,7 +10,7 @@ runs: - env: ARG_TOOLSET: ${{ inputs.toolset }} run: | - $toolset = $env:ARG_TOOLSET + $toolset = (Get-ChildItem env:ARG_TOOLSET).Value $host_linux = '${{ runner.os }}' -eq 'Linux' $host_windows = '${{ runner.os }}' -eq 'Windows' diff --git a/.github/actions/download-boost/action.yml b/.github/actions/download-boost/action.yml index 2fea082..057c733 100644 --- a/.github/actions/download-boost/action.yml +++ b/.github/actions/download-boost/action.yml @@ -13,38 +13,28 @@ runs: steps: - env: ARG_BOOST_VERSION: ${{ inputs.boost-version }} - run: echo "BOOST_VERSION=$env:ARG_BOOST_VERSION" >> $env:GITHUB_ENV - shell: pwsh - - run: | - $parent_dir = Split-Path $env:GITHUB_WORKSPACE - $cache_dir = Join-Path $parent_dir 'boost' - echo "BOOST_CACHE_DIR=$cache_dir" >> $env:GITHUB_ENV - shell: pwsh - - run: | - $dir_name = "boost_$($env:BOOST_VERSION.Replace('.', '_'))" - $dir = Join-Path $env:BOOST_CACHE_DIR $dir_name - echo "BOOST_DIR=$dir" >> $env:GITHUB_ENV - shell: pwsh - - env: ARG_NO_RETRY: ${{ inputs.no-retry }} run: | - echo '' - echo '----------------------------------------------------------------' - echo "BOOST_VERSION: $env:BOOST_VERSION" - echo "BOOST_CACHE_DIR: $env:BOOST_CACHE_DIR" - echo "BOOST_DIR: $env:BOOST_DIR" - echo '----------------------------------------------------------------' - New-Item $env:BOOST_CACHE_DIR -Force -Type Directory | Out-Null + $workspace = (Get-ChildItem env:GITHUB_WORKSPACE).Value + $version = (Get-ChildItem env:ARG_BOOST_VERSION).Value + $no_retry = (Get-ChildItem env:ARG_NO_RETRY).Value -eq '1' + + echo "BOOST_VERSION=$version" >> $env:GITHUB_ENV + + $parent_dir = Split-Path $workspace + $cache_dir = Join-Path $parent_dir 'boost' + echo "BOOST_CACHE_DIR=$cache_dir" >> $env:GITHUB_ENV - $python = 'python' - $cache_dir = $env:BOOST_CACHE_DIR + $dir_name = "boost_$($version.Replace('.', '_'))" + $dir = Join-Path $cache_dir $dir_name + echo "BOOST_DIR=$dir" >> $env:GITHUB_ENV - $no_retry = $env:ARG_NO_RETRY -eq '1' + New-Item $cache_dir -Force -Type Directory | Out-Null $args = @() if ($no_retry) { $args += '--no-retry' } - & $python -m project.boost.download --cache $cache_dir $args -- $env:BOOST_VERSION + & python -m project.boost.download --cache $cache_dir $args -- $version shell: pwsh diff --git a/.github/actions/run-example-boost/action.yml b/.github/actions/run-example-boost/action.yml index c2933f1..f1fa81c 100644 --- a/.github/actions/run-example-boost/action.yml +++ b/.github/actions/run-example-boost/action.yml @@ -1,18 +1,18 @@ name: Run examples/boost description: Run examples/boost inputs: - path: + install_dir: description: Installation directory required: true runs: using: composite steps: - env: - ARG_PATH: ${{ inputs.path }} + ARG_INSTALL_DIR: ${{ inputs.install_dir }} run: | - $path = $env:ARG_PATH + $install_dir = (Get-ChildItem env:ARG_INSTALL_DIR).Value - if ($env:CI_HOST_LINUX -and -not $env:CI_TARGET_LINUX) { + if ((Get-ChildItem env:CI_HOST_LINUX).Value -and !(Get-ChildItem env:CI_TARGET_LINUX).Value) { echo 'Not going to do that on Linux/MinGW' exit } @@ -20,15 +20,15 @@ runs: $relative_test = 'test.txt' $absolute_test = Join-Path (Get-Location).Path 'test.txt' - $exe_path = (Join-Path $path 'bin' 'foo') - $exe_path += $env:CI_EXE_EXT + $name = 'foo' + (Get-ChildItem env:CI_EXE_EXT).Value + $path = Join-Path $install_dir 'bin' $name - $actual = & $exe_path $relative_test + $actual = & $path $relative_test echo 'Actual output:' echo $actual - $expected = $exe_path,$absolute_test + $expected = $path,$absolute_test echo 'Expected output:' echo $expected diff --git a/.github/actions/run-example/action.yml b/.github/actions/run-example/action.yml index 9d3f90f..27210e9 100644 --- a/.github/actions/run-example/action.yml +++ b/.github/actions/run-example/action.yml @@ -1,30 +1,31 @@ name: Run example project description: Run example project inputs: - path: + install_dir: description: Installation directory required: true runs: using: composite steps: - env: - ARG_PATH: ${{ inputs.path }} + ARG_INSTALL_DIR: ${{ inputs.install_dir }} run: | - $path = $env:ARG_PATH + $install_dir = (Get-ChildItem env:ARG_INSTALL_DIR).Value - if ($env:CI_HOST_LINUX -and -not $env:CI_TARGET_LINUX) { - echo 'Not going to do that on Linux/MinGW' + if ((Get-ChildItem env:CI_HOST_LINUX).Value -and !(Get-ChildItem env:CI_TARGET_LINUX).Value) { + echo 'Not going to do that on Linux + MinGW' exit } - if ($env:CI_TARGET_LINUX) { - $lib = Join-Path $path 'lib' + if ((Get-ChildItem env:CI_TARGET_LINUX).Value) { + $lib = Join-Path $install_dir 'lib' if (Test-Path $lib) { $lib = Resolve-Path $lib $env:LD_LIBRARY_PATH = $lib } } - $exe_path = (Join-Path $path 'bin' 'foo') + $env:CI_EXE_EXT - echo "Executable path: $exe_path" - & $exe_path + $name = 'foo' + (Get-ChildItem env:CI_EXE_EXT).Value + $path = Join-Path $install_dir 'bin' $name + echo "Executable path: $path" + & $path shell: pwsh diff --git a/.github/actions/software-environment/action.yml b/.github/actions/software-environment/action.yml index 25d3ce5..ed36c7a 100644 --- a/.github/actions/software-environment/action.yml +++ b/.github/actions/software-environment/action.yml @@ -4,7 +4,7 @@ runs: using: composite steps: - run: | - if ($env:CI_HOST_WINDOWS) { + if ((Get-ChildItem env:CI_HOST_WINDOWS).Value) { echo 'C:\Program Files\CMake\bin' >> $env:GITHUB_PATH } shell: pwsh diff --git a/.github/workflows/boost_toolsets.yml b/.github/workflows/boost_toolsets.yml index 924e3d7..e9d0383 100644 --- a/.github/workflows/boost_toolsets.yml +++ b/.github/workflows/boost_toolsets.yml @@ -85,15 +85,15 @@ jobs: path: '${{ runner.workspace }}/boost/boost_*.tar.gz' key: 'boost_${{ matrix.boost-version }}' - - name: Clean up PATH - uses: egor-tensin/cleanup-path@v5 - if: runner.os == 'Windows' - - name: Set common variables uses: $/.github/actions/common-variables with: toolset: ${{ matrix.toolset }} + - name: Clean up PATH + uses: egor-tensin/cleanup-path@v5 + if: env.CI_HOST_WINDOWS + - name: Set up Python uses: actions/setup-python@v7 with: @@ -120,9 +120,6 @@ jobs: - name: Set up software environment uses: $/.github/actions/software-environment - with: - toolset: ${{ matrix.toolset }} - platform: ${{ matrix.platform }} - name: Set up Visual Studio uses: egor-tensin/vs-shell@v2 @@ -158,8 +155,8 @@ jobs: id: build_example uses: $/.github/actions/build-example with: - src-dir: test/examples/boost - boost-dir: ${{ env.BOOST_DIR }} + src_dir: test/examples/boost + boost_dir: ${{ env.BOOST_DIR }} toolset: ${{ matrix.toolset }} platform: ${{ matrix.platform }} configuration: ${{ matrix.configuration }} @@ -167,15 +164,15 @@ jobs: - name: Verify runtime library linkage uses: $/.github/actions/check-runtime-library with: - path: ${{ steps.build_example.outputs.install-dir }} + install_dir: ${{ steps.build_example.outputs.install_dir }} - name: Verify architecture uses: $/.github/actions/check-arch with: - path: ${{ steps.build_example.outputs.install-dir }} + install_dir: ${{ steps.build_example.outputs.install_dir }} expected: ${{ matrix.platform }} - name: Run examples/boost uses: $/.github/actions/run-example-boost with: - path: ${{ steps.build_example.outputs.install-dir }} + install_dir: ${{ steps.build_example.outputs.install_dir }} diff --git a/.github/workflows/example_toolsets.yml b/.github/workflows/example_toolsets.yml index ad294d6..c3ecd90 100644 --- a/.github/workflows/example_toolsets.yml +++ b/.github/workflows/example_toolsets.yml @@ -76,15 +76,15 @@ jobs: with: persist-credentials: false - - name: Clean up PATH - uses: egor-tensin/cleanup-path@v5 - if: runner.os == 'Windows' - - name: Set common variables uses: $/.github/actions/common-variables with: toolset: ${{ matrix.toolset }} + - name: Clean up PATH + uses: egor-tensin/cleanup-path@v5 + if: env.CI_HOST_WINDOWS + - name: Set up Python uses: actions/setup-python@v7 with: @@ -111,9 +111,6 @@ jobs: - name: Set up software environment uses: $/.github/actions/software-environment - with: - toolset: ${{ matrix.toolset }} - platform: ${{ matrix.platform }} - name: Set up Visual Studio uses: egor-tensin/vs-shell@v2 @@ -125,7 +122,7 @@ jobs: id: build uses: $/.github/actions/build-example with: - src-dir: 'test/examples/${{ matrix.example }}' + src_dir: 'test/examples/${{ matrix.example }}' toolset: ${{ matrix.toolset }} platform: ${{ matrix.platform }} configuration: ${{ matrix.configuration }} @@ -133,22 +130,22 @@ jobs: - name: Verify runtime library linkage uses: $/.github/actions/check-runtime-library with: - path: ${{ steps.build.outputs.install-dir }} + install_dir: ${{ steps.build.outputs.install_dir }} - name: Verify architecture uses: $/.github/actions/check-arch with: - path: ${{ steps.build.outputs.install-dir }} + install_dir: ${{ steps.build.outputs.install_dir }} expected: ${{ matrix.platform }} - name: Run example project uses: $/.github/actions/run-example with: - path: ${{ steps.build.outputs.install-dir }} + install_dir: ${{ steps.build.outputs.install_dir }} #- name: Check symbols # uses: $/.github/actions/check-symbols # with: - # path: ${{ steps.build.outputs.install-dir }} + # install_dir: ${{ steps.build.outputs.install_dir }} # expected: ${{ toJson(matrix.symbols) }} # if: env.CI_TARGET_ELF diff --git a/.github/workflows/msvc_versions.yml b/.github/workflows/msvc_versions.yml index 04c7307..7bf8e6f 100644 --- a/.github/workflows/msvc_versions.yml +++ b/.github/workflows/msvc_versions.yml @@ -48,15 +48,15 @@ jobs: path: '${{ runner.workspace }}/boost/boost_*.tar.gz' key: 'boost_${{ matrix.boost-version }}' - - name: Clean up PATH - uses: egor-tensin/cleanup-path@v5 - if: runner.os == 'Windows' - - name: Set common variables uses: $/.github/actions/common-variables with: toolset: ${{ matrix.toolset }} + - name: Clean up PATH + uses: egor-tensin/cleanup-path@v5 + if: env.CI_HOST_WINDOWS + - name: Set up Python uses: actions/setup-python@v7 with: @@ -64,9 +64,6 @@ jobs: - name: Set up software environment uses: $/.github/actions/software-environment - with: - toolset: ${{ matrix.toolset }} - platform: ${{ matrix.platform }} - name: Download Boost uses: $/.github/actions/download-boost @@ -96,8 +93,8 @@ jobs: id: build_example uses: $/.github/actions/build-example with: - src-dir: test/examples/boost - boost-dir: ${{ env.BOOST_DIR }} + src_dir: test/examples/boost + boost_dir: ${{ env.BOOST_DIR }} toolset: ${{ matrix.toolset }} platform: ${{ matrix.platform }} configuration: ${{ matrix.configuration }} @@ -105,15 +102,15 @@ jobs: - name: Verify runtime library linkage uses: $/.github/actions/check-runtime-library with: - path: ${{ steps.build_example.outputs.install-dir }} + install_dir: ${{ steps.build_example.outputs.install_dir }} - name: Verify architecture uses: $/.github/actions/check-arch with: - path: ${{ steps.build_example.outputs.install-dir }} + install_dir: ${{ steps.build_example.outputs.install_dir }} expected: ${{ matrix.platform }} - name: Run examples/boost uses: $/.github/actions/run-example-boost with: - path: ${{ steps.build_example.outputs.install-dir }} + install_dir: ${{ steps.build_example.outputs.install_dir }} |
