diff --git a/.github/workflows/msvc.yml b/.github/workflows/msvc.yml index 2fac5fc..96d04d5 100644 --- a/.github/workflows/msvc.yml +++ b/.github/workflows/msvc.yml @@ -24,6 +24,39 @@ permissions: contents: read jobs: + + prepare-conan-cache: + name: Prepare Conan cache for Windows + runs-on: windows-2022 + steps: + - name: Check out code + uses: actions/checkout@v3 + + - name: Cache Conan + id: cache-conan + uses: actions/cache@v4 + with: + path: | + ~/.conan2 + build\generators + CMakeUserPresets.json + key: ${{ runner.os }}-win22-conan-${{ hashFiles('conanfile.txt') }} + restore-keys: ${{ runner.os }}-win22-conan + + - name: Install Conan + if: steps.cache-conan.outputs.cache-hit != 'true' + run: | + python -m pip install --upgrade pip + pip install conan + + - name: Set up Conan + if: steps.cache-conan.outputs.cache-hit != 'true' + run: | + New-Item -ItemType Directory -Force -Path build + cd build + conan profile detect + conan install .. -s compiler.cppstd=17 --build=never + analyze: permissions: contents: read # for actions/checkout to fetch code @@ -36,6 +69,31 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Cache Conan + id: cache-conan + uses: actions/cache@v4 + with: + path: | + ~/.conan2 + build\generators + CMakeUserPresets.json + key: ${{ runner.os }}-win22-conan-${{ hashFiles('conanfile.txt') }} + restore-keys: ${{ runner.os }}-win22-conan + + - name: Install Conan + if: steps.cache-conan.outputs.cache-hit != 'true' + run: | + python -m pip install --upgrade pip + pip install conan + + - name: Set up Conan + if: steps.cache-conan.outputs.cache-hit != 'true' + run: | + New-Item -ItemType Directory -Force -Path build + cd build + conan profile detect + conan install .. -s compiler.cppstd=17 --build=never + - name: Configure CMake run: cmake -B ${{ env.build }}