From 323b3f29e57880674c47284a286374df7981548f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Do=C4=9Fa=20Oru=C3=A7?= Date: Mon, 18 Nov 2024 00:22:07 +0300 Subject: [PATCH] Update cmake-multi-platform.yml --- .github/workflows/cmake-multi-platform.yml | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 3eef4322..62788475 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -58,17 +58,35 @@ jobs: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" echo "scripts-dir=${{ github.workspace }}/scripts" >> "$GITHUB_OUTPUT" echo "vcpkg-dir=${{ github.workspace }}/vcpkg" >> "$GITHUB_OUTPUT" - + + - name: Clean vcpkg directory if exists (Linux) + if: runner.os == 'Linux' + shell: bash + run: | + echo "Cleaning vcpkg directory at ${{ steps.strings.outputs.vcpkg-dir }}..." + rm -rf "${{ steps.strings.outputs.vcpkg-dir }}" + + - name: Clean vcpkg directory if exists (Windows) + if: runner.os == 'Windows' + shell: pwsh + run: | + $vcpkgDir = "${{ steps.strings.outputs.vcpkg-dir }}" + Write-Host "Cleaning vcpkg directory at $vcpkgDir..." + if (Test-Path -Path $vcpkgDir) { + Remove-Item -Recurse -Force -Path $vcpkgDir + } + - name: Cache vcpkg uses: actions/cache@v3 with: path: ${{ steps.strings.outputs.vcpkg-dir }} key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }} restore-keys: | - ${{ runner.os }}-vcpkg- + ${{ runner.os }}-${{ runner.build_type }}-vcpkg-cache - name: Run (Linux-specific) script for apt-get if: runner.os == 'Linux' + shell: bash run: | chmod +x ${{ steps.strings.outputs.scripts-dir }}/fetch_apt_get.sh ${{ steps.strings.outputs.scripts-dir }}/fetch_apt_get.sh