From 9e75036947905d4a8505f9a975a0f49fb810b0dd Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 29 Dec 2025 17:50:29 +0100 Subject: workflows/test: verify that a specific version is installed --- .github/actions/check-cc/action.yml | 11 +++++++++-- .github/workflows/test.yml | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/actions/check-cc/action.yml b/.github/actions/check-cc/action.yml index 5a6daa8..9f29631 100644 --- a/.github/actions/check-cc/action.yml +++ b/.github/actions/check-cc/action.yml @@ -1,11 +1,13 @@ name: Check cc/c++ description: Check cc/c++ +inputs: + version: + description: GCC version to grep for + required: false runs: using: composite steps: - run: | - $version = '${{ inputs.version }}' - function Check-Exe { param( [Parameter(Mandatory=$true)] @@ -18,6 +20,11 @@ runs: # Is this really the most stable piece of `gcc --version` output? $($output | Select-String -Pattern "This is free software; see the source for copying conditions." -SimpleMatch -Quiet) -or $(throw "Unexpected `$Exe --version` output") + + $version = '${{ inputs.version }}' + if ($version) { + $($output | Select-String -Pattern $version -SimpleMatch -Quiet) -or $(throw "Unexpected `$Exe --version` output") + } } Check-Exe cc diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1a62ee6..c74c03b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,6 +61,10 @@ jobs: uses: ./ with: version: '${{ matrix.version }}' + - name: Verify the version + uses: ./.github/actions/check-cc + with: + version: '${{ matrix.version }}' - name: Build foo.exe run: | & '${{ steps.setup.outputs.gxx }}' -std=c++14 -o foo foo.cpp -- cgit v1.3