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 /.github/workflows | |
| 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/workflows/boost_toolsets.yml | 21 | ||||
| -rw-r--r-- | .github/workflows/example_toolsets.yml | 21 | ||||
| -rw-r--r-- | .github/workflows/msvc_versions.yml | 21 |
3 files changed, 27 insertions, 36 deletions
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 }} |
