Skip to content

Commit c60bafb

Browse files
chore: update .github/workflows/sphinxbuild.yml from master branch
Signed-off-by: GitHub <noreply@github.com>
1 parent 5438f89 commit c60bafb

File tree

1 file changed

+35
-17
lines changed

1 file changed

+35
-17
lines changed

.github/workflows/sphinxbuild.yml

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,17 @@ jobs:
2323
- name: Configure apt cache
2424
run: |
2525
mkdir -p ${{ runner.temp }}/.cache/archives
26+
mkdir -p ${{ runner.temp }}/.cache/lists
2627
echo 'Dir::Cache::archives "${{ runner.temp }}/.cache/archives";' | sudo tee /etc/apt/apt.conf.d/apt-cache-tmp
2728
2829
- name: Cache LaTeX apt packages
2930
id: cache-latex-apt
3031
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
3132
with:
32-
path: ${{ runner.temp }}/.cache/archives
33-
key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023
33+
path: |
34+
${{ runner.temp }}/.cache/archives
35+
${{ runner.temp }}/.cache/lists
36+
key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v2
3437
restore-keys: |
3538
latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-
3639
latex-apt-${{ runner.os }}-${{ runner.arch }}-
@@ -39,28 +42,38 @@ jobs:
3942
- name: Download LaTeX packages (cache miss only)
4043
if: steps.cache-latex-apt.outputs.cache-hit != 'true'
4144
run: |
42-
sudo DEBIAN_FRONTEND=noninteractive apt-get update
45+
for i in 1 2 3; do
46+
sudo DEBIAN_FRONTEND=noninteractive apt-get update \
47+
-o Dir::State::lists="${{ runner.temp }}/.cache/lists" \
48+
-o Acquire::Retries=3 && break
49+
echo "apt-get update failed (attempt $i), retrying in 15s..."
50+
sleep 15
51+
done
4352
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
4453
--download-only \
54+
-o Dir::State::lists="${{ runner.temp }}/.cache/lists" \
4555
python3-pil python3-pip texlive-fonts-recommended latexmk \
4656
texlive-latex-extra texlive-latex-recommended texlive-xetex \
47-
texlive-fonts-extra-links texlive-fonts-extra xindy
57+
texlive-fonts-extra-links texlive-fonts-extra xindy tex-gyre
4858
# Ensure downloaded packages are owned by the current user so they can be cached
49-
sudo chown -R $(id -u):$(id -g) ${{ runner.temp }}/.cache/archives
59+
sudo chown -R $(id -u):$(id -g) ${{ runner.temp }}/.cache/
5060
5161
- name: Save LaTeX apt cache (cache miss only)
5262
if: steps.cache-latex-apt.outputs.cache-hit != 'true'
5363
uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
5464
with:
55-
path: ${{ runner.temp }}/.cache/archives
56-
key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023
65+
path: |
66+
${{ runner.temp }}/.cache/archives
67+
${{ runner.temp }}/.cache/lists
68+
key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v2
5769

5870
build:
5971
name: Build ${{ matrix.manual.name }}
6072
runs-on: ubuntu-latest
6173
needs: setup-latex-cache
6274

6375
strategy:
76+
fail-fast: false
6477
matrix:
6578
manual:
6679
- name: "user_manual"
@@ -102,7 +115,7 @@ jobs:
102115
- name: Checkout repository
103116
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
104117

105-
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
118+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
106119
with:
107120
python-version: "3.10"
108121
cache: "pip"
@@ -114,29 +127,34 @@ jobs:
114127
if: ${{ matrix.manual.build_pdf_path }}
115128
run: |
116129
mkdir -p ${{ runner.temp }}/.cache/archives
130+
mkdir -p ${{ runner.temp }}/.cache/lists
117131
echo 'Dir::Cache::archives "${{ runner.temp }}/.cache/archives";' | sudo tee /etc/apt/apt.conf.d/apt-cache-tmp
118132
119133
- name: Restore LaTeX apt cache
120134
if: ${{ matrix.manual.build_pdf_path }}
121135
uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
122136
with:
123137
# Use relative path https://github.com/actions/cache/issues/1127
124-
path: ${{ runner.temp }}/.cache/archives
125-
key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023
138+
path: |
139+
${{ runner.temp }}/.cache/archives
140+
${{ runner.temp }}/.cache/lists
141+
key: latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-texlive-2023-v2
126142
restore-keys: |
127143
latex-apt-${{ runner.os }}-${{ runner.arch }}-ubuntu-24.04-
128144
latex-apt-${{ runner.os }}-${{ runner.arch }}-
129145
130146
- name: Install LaTeX from cache
131147
if: ${{ matrix.manual.build_pdf_path }}
132-
timeout-minutes: 3
148+
timeout-minutes: 5
133149
run: |
134-
sudo DEBIAN_FRONTEND=noninteractive apt-get update
135-
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
136-
--no-download \
137-
python3-pil python3-pip texlive-fonts-recommended latexmk \
138-
texlive-latex-extra texlive-latex-recommended texlive-xetex \
139-
texlive-fonts-extra-links texlive-fonts-extra xindy
150+
debs=(${{ runner.temp }}/.cache/archives/*.deb)
151+
if [ ! -e "${debs[0]}" ]; then
152+
echo "No .deb files found in cache archives — cache may be empty or missing." >&2
153+
exit 1
154+
fi
155+
sudo dpkg -i --force-depends "${debs[@]}"
156+
sudo DEBIAN_FRONTEND=noninteractive apt-get install -f -y --no-install-recommends \
157+
-o Dir::State::lists="${{ runner.temp }}/.cache/lists"
140158
141159
- name: Build html documentation
142160
run: cd ${{ matrix.manual.directory }} && make ${{ matrix.manual.make_target }}

0 commit comments

Comments
 (0)