Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 18 additions & 27 deletions .github/actions/vcpkg-cache/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
name: 'Setup vcpkg cache'
inputs:
vcpkg-root-path:
description: 'Path where to install vcpkg'
required: true
type: string
runs:
using: "composite"
steps:
Expand All @@ -13,41 +8,38 @@ runs:
run: |
echo "Installing vcpkg"

VCPKG_DIR=${{ inputs.vcpkg-root-path }}
echo "before VCPKG_DIR=$VCPKG_DIR"
VCPKG_DIR="${VCPKG_DIR//\\//}" # Convert backslashes to forward slashes for compatibility
echo "after VCPKG_DIR=$VCPKG_DIR"
VCPKG_DIR=${{ runner.temp }}/.vcpkg-cache
echo "VCPKG_DIR=$VCPKG_DIR"

echo "VCPKG_INSTALLATION_ROOT=$VCPKG_DIR" >> $GITHUB_ENV
echo "PATH=$VCPKG_DIR:$PATH" >> $GITHUB_ENV
echo "VCPKG_DEFAULT_BINARY_CACHE=$VCPKG_DIR/.cache" >> $GITHUB_ENV
echo "VCPKG_DEFAULT_BINARY_CACHE=$VCPKG_DIR" >> $GITHUB_ENV
which vcpkg

git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh --disableMetrics
mkdir $VCPKG_DIR/.cache
#git clone https://github.com/microsoft/vcpkg.git
#cd vcpkg
#./bootstrap-vcpkg.sh --disableMetrics
mkdir -p $VCPKG_DIR
cd $VCPKG_DIR
ls

- name: cmdll vcpkg Windows
shell: cmd
if: runner.os == 'Windows'
run: |
echo "Installing vcpkg"

set VCPKG_DIR=${{ inputs.vcpkg-root-path }}
set VCPKG_DIR=${{ runner.temp }}\.vcpkg-cache

echo "VCPKG_DIR=%VCPKG_DIR%"

echo "Vcpkg is installed at: %VCPKG_INSTALLATION_ROOT%"
echo VCPKG_INSTALLATION_ROOT=%VCPKG_DIR%>> %GITHUB_ENV%
echo VCPKG_DEFAULT_BINARY_CACHE=%VCPKG_DIR%\.cache>> %GITHUB_ENV%
echo PATH=%VCPKG_DIR%;%PATH%>> %GITHUB_ENV%
echo VCPKG_DEFAULT_BINARY_CACHE=%VCPKG_DIR%>> %GITHUB_ENV%
where vcpkg

git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
call .\bootstrap-vcpkg.bat
mkdir "%VCPKG_DIR%\.cache"
#git clone https://github.com/microsoft/vcpkg.git
#cd vcpkg
#call .\bootstrap-vcpkg.bat
mkdir "%VCPKG_DIR%"
cd %VCPKG_DIR%
dir

- name: Env
if: False
Expand All @@ -67,8 +59,7 @@ runs:
uses: actions/cache@v4
with:
enableCrossOsArchive: true
path: |
${{ inputs.vcpkg-root-path }}/.cache
path: ${{ runner.temp }}/.vcpkg-cache
key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }}
restore-keys: |
${{ runner.os }}-vcpkg-
5 changes: 0 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ jobs:

build:

env:
VCPKG_INSTALLATION_ROOT: ${{ github.workspace }}/vcpkg

runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -44,8 +41,6 @@ jobs:

- name: Setup cache
uses: ./.github/actions/vcpkg-cache
with:
vcpkg-root-path: ${{ env.VCPKG_INSTALLATION_ROOT }}

- name: Configure project
run: |
Expand Down