From 63a1e50b979513f1cd1fb722a363b866ec070800 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 14:19:29 +0000 Subject: [PATCH 1/2] fix(ci): cache texlive-fonts-extra differently Signed-off-by: skjnldsv --- .github/workflows/sphinxbuild.yml | 64 ++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 6 deletions(-) diff --git a/.github/workflows/sphinxbuild.yml b/.github/workflows/sphinxbuild.yml index 150e989d9d0..ec4fac84bd0 100644 --- a/.github/workflows/sphinxbuild.yml +++ b/.github/workflows/sphinxbuild.yml @@ -17,7 +17,8 @@ concurrency: jobs: setup-latex-cache: name: Cache LaTeX packages - runs-on: ubuntu-latest + # Force running on GitHub-hosted runners + runs-on: ubuntu-24.04 steps: - name: Configure apt cache @@ -33,7 +34,7 @@ jobs: path: | ${{ runner.temp }}/.cache/archives ${{ runner.temp }}/.cache/lists - key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v2 + key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v3 restore-keys: | latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04- latex-apt-${{ runner.os }}-${{ runner.arch }}- @@ -54,7 +55,7 @@ jobs: -o Dir::State::lists="${{ runner.temp }}/.cache/lists" \ python3-pil python3-pip texlive-fonts-recommended latexmk \ texlive-latex-extra texlive-latex-recommended texlive-xetex \ - texlive-fonts-extra-links texlive-fonts-extra xindy tex-gyre + texlive-fonts-extra-links xindy tex-gyre # Ensure downloaded packages are owned by the current user so they can be cached sudo chown -R $(id -u):$(id -g) ${{ runner.temp }}/.cache/ @@ -65,7 +66,42 @@ jobs: path: | ${{ runner.temp }}/.cache/archives ${{ runner.temp }}/.cache/lists - key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v2 + key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v3 + + - name: Check texlive-fonts-extra installed files cache + id: cache-fonts-extra + uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: ~/.cache/texlive-fonts-extra + key: latex-fonts-extra-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v1 + lookup-only: true + + - name: Install texlive-fonts-extra and cache installed files (cache miss only) + if: steps.cache-fonts-extra.outputs.cache-hit != 'true' + run: | + for i in 1 2 3; do + sudo DEBIAN_FRONTEND=noninteractive apt-get update \ + -o Acquire::Retries=3 && break + echo "apt-get update failed (attempt $i), retrying in 15s..." + sleep 15 + done + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends texlive-fonts-extra + mkdir -p ~/.cache/texlive-fonts-extra + while IFS= read -r f; do + [ -f "$f" ] || [ -L "$f" ] || continue + rel="${f#/}" + dir="$HOME/.cache/texlive-fonts-extra/$(dirname "$rel")" + mkdir -p "$dir" + sudo cp -P "$f" "$dir/" + done < <(dpkg -L texlive-fonts-extra) + sudo chown -R $(id -u):$(id -g) ~/.cache/texlive-fonts-extra + + - name: Save texlive-fonts-extra installed files cache (cache miss only) + if: steps.cache-fonts-extra.outputs.cache-hit != 'true' + uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: ~/.cache/texlive-fonts-extra + key: latex-fonts-extra-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v1 build: name: Build ${{ matrix.manual.name }} @@ -138,14 +174,30 @@ jobs: path: | ${{ runner.temp }}/.cache/archives ${{ runner.temp }}/.cache/lists - key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v2 + key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v3 restore-keys: | latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04- latex-apt-${{ runner.os }}-${{ runner.arch }}- + - name: Restore texlive-fonts-extra installed files + if: ${{ matrix.manual.build_pdf_path }} + uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: ~/.cache/texlive-fonts-extra + key: latex-fonts-extra-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v1 + + - name: Install texlive-fonts-extra from cache + if: ${{ matrix.manual.build_pdf_path }} + run: | + if [ -d ~/.cache/texlive-fonts-extra ]; then + sudo cp -r ~/.cache/texlive-fonts-extra/. / + else + echo "texlive-fonts-extra cache not found, installing from apt..." >&2 + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends texlive-fonts-extra + fi + - name: Install LaTeX from cache if: ${{ matrix.manual.build_pdf_path }} - timeout-minutes: 5 run: | debs=(${{ runner.temp }}/.cache/archives/*.deb) if [ ! -e "${debs[0]}" ]; then From 0d1af66681a9c91b9b6fa82f6b1a6c5bb85a289d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 17 Apr 2026 15:01:24 +0000 Subject: [PATCH 2/2] simplify: drop .deb apt cache, install other LaTeX packages normally, keep only texlive-fonts-extra file cache Agent-Logs-Url: https://github.com/nextcloud/documentation/sessions/3cf79ce0-c254-4113-bab0-64e3ce8f361f Co-authored-by: skjnldsv <14975046+skjnldsv@users.noreply.github.com> --- .github/workflows/sphinxbuild.yml | 87 ++++--------------------------- 1 file changed, 11 insertions(+), 76 deletions(-) diff --git a/.github/workflows/sphinxbuild.yml b/.github/workflows/sphinxbuild.yml index ec4fac84bd0..44298b2696e 100644 --- a/.github/workflows/sphinxbuild.yml +++ b/.github/workflows/sphinxbuild.yml @@ -21,53 +21,6 @@ jobs: runs-on: ubuntu-24.04 steps: - - name: Configure apt cache - run: | - mkdir -p ${{ runner.temp }}/.cache/archives - mkdir -p ${{ runner.temp }}/.cache/lists - echo 'Dir::Cache::archives "${{ runner.temp }}/.cache/archives";' | sudo tee /etc/apt/apt.conf.d/apt-cache-tmp - - - name: Cache LaTeX apt packages - id: cache-latex-apt - uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 - with: - path: | - ${{ runner.temp }}/.cache/archives - ${{ runner.temp }}/.cache/lists - key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v3 - restore-keys: | - latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04- - latex-apt-${{ runner.os }}-${{ runner.arch }}- - lookup-only: true - - - name: Download LaTeX packages (cache miss only) - if: steps.cache-latex-apt.outputs.cache-hit != 'true' - run: | - for i in 1 2 3; do - sudo DEBIAN_FRONTEND=noninteractive apt-get update \ - -o Dir::State::lists="${{ runner.temp }}/.cache/lists" \ - -o Acquire::Retries=3 && break - echo "apt-get update failed (attempt $i), retrying in 15s..." - sleep 15 - done - sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - --download-only \ - -o Dir::State::lists="${{ runner.temp }}/.cache/lists" \ - python3-pil python3-pip texlive-fonts-recommended latexmk \ - texlive-latex-extra texlive-latex-recommended texlive-xetex \ - texlive-fonts-extra-links xindy tex-gyre - # Ensure downloaded packages are owned by the current user so they can be cached - sudo chown -R $(id -u):$(id -g) ${{ runner.temp }}/.cache/ - - - name: Save LaTeX apt cache (cache miss only) - if: steps.cache-latex-apt.outputs.cache-hit != 'true' - uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 - with: - path: | - ${{ runner.temp }}/.cache/archives - ${{ runner.temp }}/.cache/lists - key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v3 - - name: Check texlive-fonts-extra installed files cache id: cache-fonts-extra uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 @@ -159,26 +112,6 @@ jobs: - name: Install pip dependencies run: pip install -r requirements.txt - - name: Configure apt cache - if: ${{ matrix.manual.build_pdf_path }} - run: | - mkdir -p ${{ runner.temp }}/.cache/archives - mkdir -p ${{ runner.temp }}/.cache/lists - echo 'Dir::Cache::archives "${{ runner.temp }}/.cache/archives";' | sudo tee /etc/apt/apt.conf.d/apt-cache-tmp - - - name: Restore LaTeX apt cache - if: ${{ matrix.manual.build_pdf_path }} - uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 - with: - # Use relative path https://github.com/actions/cache/issues/1127 - path: | - ${{ runner.temp }}/.cache/archives - ${{ runner.temp }}/.cache/lists - key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v3 - restore-keys: | - latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04- - latex-apt-${{ runner.os }}-${{ runner.arch }}- - - name: Restore texlive-fonts-extra installed files if: ${{ matrix.manual.build_pdf_path }} uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 @@ -196,17 +129,19 @@ jobs: sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends texlive-fonts-extra fi - - name: Install LaTeX from cache + - name: Install LaTeX packages if: ${{ matrix.manual.build_pdf_path }} run: | - debs=(${{ runner.temp }}/.cache/archives/*.deb) - if [ ! -e "${debs[0]}" ]; then - echo "No .deb files found in cache archives — cache may be empty or missing." >&2 - exit 1 - fi - sudo dpkg -i --force-depends "${debs[@]}" - sudo DEBIAN_FRONTEND=noninteractive apt-get install -f -y --no-install-recommends \ - -o Dir::State::lists="${{ runner.temp }}/.cache/lists" + for i in 1 2 3; do + sudo DEBIAN_FRONTEND=noninteractive apt-get update \ + -o Acquire::Retries=3 && break + echo "apt-get update failed (attempt $i), retrying in 15s..." + sleep 15 + done + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + texlive-fonts-recommended latexmk texlive-latex-extra \ + texlive-latex-recommended texlive-xetex texlive-fonts-extra-links \ + xindy tex-gyre - name: Build html documentation run: cd ${{ matrix.manual.directory }} && make ${{ matrix.manual.make_target }}