diff --git a/.github/workflows/bvt.yml b/.github/workflows/bvt.yml index f27ee6be..58b18863 100644 --- a/.github/workflows/bvt.yml +++ b/.github/workflows/bvt.yml @@ -36,10 +36,16 @@ jobs: os: [windows-2019, windows-2022] build_type: [x64-Release] arch: [amd64] - + steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Set variable within step + env: + VCPKG_COMMIT_ID: ${{ steps.get_commit.outputs.commit }} + run: echo "Latest vcpkg commit is $VCPKG_COMMIT_ID" + - name: Clone test repository uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: @@ -81,11 +87,30 @@ jobs: echo "::error Unknown architecture/build-type triplet mapping" } + - name: Get latest vcpkg commit hash + shell: pwsh + run: | + echo "Fetching latest vcpkg commit hash..." + git clone https://github.com/microsoft/vcpkg.git ${{ runner.workspace }}/vcpkg + Set-Location ${{ runner.workspace }}/vcpkg + $VCPKG_COMMIT_ID = git rev-parse HEAD + echo "VCPKG_COMMIT_ID=$VCPKG_COMMIT_ID" >> $GITHUB_ENV + + - name: Print vcpkg commit hash + shell: pwsh + run: | + echo "Using vcpkg commit: $VCPKG_COMMIT_ID" + + - name: Get latest vcpkg commit hash + shell: pwsh + run: | + echo "commit=$(git ls-remote https://github.com/microsoft/vcpkg.git HEAD | awk '{print $1}')" >> $GITHUB_ENV + - uses: lukka/run-vcpkg@7d259227a1fb6471a0253dd5ab7419835228f7d7 # v11 with: runVcpkgInstall: true vcpkgJsonGlob: '**/build/vcpkg.json' - vcpkgGitCommitId: '${{ vars.VCPKG_COMMIT_ID }}' + vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_ID }}' - name: 'Configure CMake' working-directory: ${{ github.workspace }}