Skip to content

Commit c566fee

Browse files
committed
-
1 parent 33af48f commit c566fee

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

.github/actions/vcpkg-cache/action.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,23 @@
11
name: 'Setup vcpkg cache'
2+
inputs:
3+
vcpkg-root-path:
4+
description: 'Path where to install vcpkg'
5+
required: true
6+
type: string
27
runs:
38
using: "composite"
49
steps:
5-
- name: Install vcpkg
10+
- name: Install vcpkg Linux
611
shell: bash
12+
if: runner.os == 'Linux'
713
run: |
814
echo "Installing vcpkg"
915
10-
VCPKG_DIR=$GITHUB_WORKSPACE/vcpkg
16+
VCPKG_DIR=${{ inputs.vcpkg-root-path }}/vcpkg
1117
echo "before VCPKG_DIR=$VCPKG_DIR"
1218
VCPKG_DIR="${VCPKG_DIR//\\//}" # Convert backslashes to forward slashes for compatibility
1319
echo "after VCPKG_DIR=$VCPKG_DIR"
1420
15-
echo "Runner OS is: $RUNNER_OS"
16-
if [[ "$RUNNER_OS" == "Linux" ]]; then
17-
echo "Running on Linux"
18-
elif [[ "$RUNNER_OS" == "Windows" ]]; then
19-
echo "Running on Windows"
20-
VCPKG_DIR="${VCPKG_DIR/:/}"
21-
VCPKG_DIR="/${VCPKG_DIR}"
22-
fi
23-
2421
echo "VCPKG_INSTALLATION_ROOT=$VCPKG_DIR" >> $GITHUB_ENV
2522
echo "PATH=$VCPKG_DIR:$PATH" >> $GITHUB_ENV
2623
echo "VCPKG_DEFAULT_BINARY_CACHE=$VCPKG_DIR/.cache" >> $GITHUB_ENV
@@ -31,6 +28,24 @@ runs:
3128
./bootstrap-vcpkg.sh --disableMetrics
3229
mkdir $VCPKG_DIR/.cache
3330
31+
- name: cmdll vcpkg Windows
32+
shell: cmd
33+
if: runner.os == 'Windows'
34+
run: |
35+
echo "Installing vcpkg"
36+
37+
VCPKG_DIR=%GITHUB_WORKSPACE%/vcpkg
38+
39+
echo "VCPKG_INSTALLATION_ROOT=%VCPKG_DIR%" >> %GITHUB_ENV%
40+
echo "PATH=%VCPKG_DIR%;%PATH%" >> %GITHUB_ENV%
41+
echo "VCPKG_DEFAULT_BINARY_CACHE=%VCPKG_DIR%\.cache" >> %GITHUB_ENV%
42+
where vcpkg
43+
44+
git clone https://github.com/microsoft/vcpkg.git
45+
cd vcpkg
46+
.\bootstrap-vcpkg.bat --disableMetrics
47+
mkdir %VCPKG_DIR%\.cache
48+
3449
- name: Env
3550
shell: bash
3651
run: |

0 commit comments

Comments
 (0)