aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/actions/run-example-boost/action.yml
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2026-10-19 04:48:26 +0300
committerEgor Tensin <egor@tensin.name>2026-10-19 05:23:15 +0300
commitb1bfbd3501b6521d3204b5d060f88a8f6153f945 (patch)
treebf2d3869023e1dd20bf395d5dca52f4b6b2b4f39 /.github/actions/run-example-boost/action.yml
parentworkflows/lint: add a zizmor job (diff)
downloadcmake-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/run-example-boost/action.yml16
1 files changed, 8 insertions, 8 deletions
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