Skip to content

Commit

Permalink
8306658: GHA: MSVC installation could be optional since it might alre…
Browse files Browse the repository at this point in the history
…ady be pre-installed

Backport-of: d980cb48793f2bb662aece545fb00724c12a5613
  • Loading branch information
RealCLanger committed Apr 25, 2023
1 parent bf0606a commit d5cbf22
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,26 @@ jobs:
id: gtest
uses: ./.github/actions/get-gtest

- name: 'Check toolchain installed'
id: toolchain-check
run: |
set +e
'/c/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/vc/auxiliary/build/vcvars64.bat' -vcvars_ver=${{ inputs.msvc-toolset-version }}
if [ $? -eq 0 ]; then
echo "Toolchain is already installed"
echo "toolchain-installed=true" >> $GITHUB_OUTPUT
else
echo "Toolchain is not yet installed"
echo "toolchain-installed=false" >> $GITHUB_OUTPUT
fi
- name: 'Install toolchain and dependencies'
run: |
# Run Visual Studio Installer
'/c/Program Files (x86)/Microsoft Visual Studio/Installer/vs_installer.exe' \
modify --quiet --installPath 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise' \
--add Microsoft.VisualStudio.Component.VC.${{ inputs.msvc-toolset-version }}.${{ inputs.msvc-toolset-architecture }}
if: steps.toolchain-check.outputs.toolchain-installed != 'true'

- name: 'Configure'
run: >
Expand Down

1 comment on commit d5cbf22

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.