From a8ca6aec756a8dd3e3a89e3ae2c85acffc53cc9d Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 9 Jun 2025 16:02:30 +0200 Subject: [PATCH] CI script updated to cache latex installation on windows --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d565b80..fd380f5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: - python-version: [3.12] + python-version: ["3.10", 3.13] steps: - name: Check out code @@ -47,7 +47,7 @@ jobs: strategy: matrix: - python-version: ["3.10", 3.13] + python-version: ["3.10"] steps: - name: Check out code @@ -87,7 +87,7 @@ jobs: strategy: matrix: - python-version: ["3.10", "3.13"] + python-version: ["3.10"] steps: - name: Check out code @@ -98,16 +98,31 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install LaTeX - run: choco install miktex + - name: Cache MiKTeX Portable + uses: actions/cache@v4 + with: + path: miktex-portable + key: miktex-portable-${{ runner.os }}-24.1-x64 + + - name: Set up MiKTeX Portable + if: steps.cache.outputs.cache-hit != 'true' + run: | + Invoke-WebRequest https://miktex.org/download/win/miktexsetup-x64.zip -OutFile miktexsetup-x64.zip + Expand-Archive miktexsetup-x64.zip -DestinationPath . + .\miktexsetup_standalone.exe --package-set=basic --portable=.\miktex-portable ` + --use-registry=no --modify-path=no --quiet ` + --local-package-repository=.\miktex-portable\miktex-packages download + .\miktexsetup_standalone.exe --package-set=basic --portable=.\miktex-portable ` + --use-registry=no --modify-path=no --quiet ` + --local-package-repository=.\miktex-portable\miktex-packages install - name: Check directory structure of MiKTeX installation run: | - dir "C:\Program Files\MiKTeX\miktex\bin\x64\*" + dir ".\miktex-portable\texmfs\install\miktex\bin\x64\*" - name: Add miktex to PATH run: | - echo "PATH=$PATH;C:\Program Files\MiKTeX\miktex\bin\x64" | Out-File -FilePath $env:GITHUB_ENV -Append + echo "PATH=$PATH;$(pwd)\miktex-portable\miktex\bin\x64" | Out-File -FilePath $env:GITHUB_ENV -Append - name: Show path variable run: | @@ -120,7 +135,6 @@ jobs: - name: Install Python dependencies run: | - python -m pip install --upgrade pip python -m pip install -e .[dev] - name: Run tests with pytest