Skip to content

Commit 541e2bb

Browse files
committed
CI: harden the cache.yml graphviz step too; two attempts with wider per-attempt timeouts (4m/14m)
Addresses Copilot review on QuantEcon/lecture-python.zh-cn#263: the cache.yml graphviz step was missed by a name match, and three 3m/9m attempts could never let a slow-but-progressing install finish. Now two attempts at 4m (graphviz) / 14m (texlive) inside the unchanged 10/30-minute step budgets.
1 parent 0fdc09a commit 541e2bb

3 files changed

Lines changed: 21 additions & 13 deletions

File tree

.github/workflows/cache.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,25 @@ jobs:
2222
environment-file: environment.yml
2323
activate-environment: quantecon
2424
- name: graphviz Support # TODO: required?
25+
timeout-minutes: 10
2526
run: |
26-
sudo apt-get -qq update && sudo apt-get install -y graphviz
27+
# Retried with a per-attempt timeout: a stalled Ubuntu mirror otherwise
28+
# hangs this step for hours (two 358-minute hangs on 2026-08-18).
29+
pkgs="graphviz"
30+
for attempt in 1 2; do
31+
timeout 4m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
32+
if [ "$attempt" = 2 ]; then echo "apt-get failed after 2 attempts"; exit 1; fi
33+
echo "apt-get attempt $attempt failed; retrying in 30s"; sleep 30
34+
done
2735
- name: Install latex dependencies
2836
timeout-minutes: 30
2937
run: |
3038
# Retried with a per-attempt timeout: a stalled Ubuntu mirror otherwise
3139
# hangs this step for hours (two 358-minute hangs on 2026-08-18).
3240
pkgs="texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-xetex latexmk xindy dvipng cm-super"
33-
for attempt in 1 2 3; do
34-
timeout 9m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
35-
if [ "$attempt" = 3 ]; then echo "apt-get failed after 3 attempts"; exit 1; fi
41+
for attempt in 1 2; do
42+
timeout 14m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
43+
if [ "$attempt" = 2 ]; then echo "apt-get failed after 2 attempts"; exit 1; fi
3644
echo "apt-get attempt $attempt failed; retrying in 30s"; sleep 30
3745
done
3846
- name: Build HTML

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
# Retried with a per-attempt timeout: a stalled Ubuntu mirror otherwise
2424
# hangs this step for hours (two 358-minute hangs on 2026-08-18).
2525
pkgs="graphviz"
26-
for attempt in 1 2 3; do
27-
timeout 3m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
28-
if [ "$attempt" = 3 ]; then echo "apt-get failed after 3 attempts"; exit 1; fi
26+
for attempt in 1 2; do
27+
timeout 4m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
28+
if [ "$attempt" = 2 ]; then echo "apt-get failed after 2 attempts"; exit 1; fi
2929
echo "apt-get attempt $attempt failed; retrying in 30s"; sleep 30
3030
done
3131
- name: Install latex dependencies
@@ -34,9 +34,9 @@ jobs:
3434
# Retried with a per-attempt timeout: a stalled Ubuntu mirror otherwise
3535
# hangs this step for hours (two 358-minute hangs on 2026-08-18).
3636
pkgs="texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-xetex latexmk xindy dvipng cm-super"
37-
for attempt in 1 2 3; do
38-
timeout 9m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
39-
if [ "$attempt" = 3 ]; then echo "apt-get failed after 3 attempts"; exit 1; fi
37+
for attempt in 1 2; do
38+
timeout 14m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
39+
if [ "$attempt" = 2 ]; then echo "apt-get failed after 2 attempts"; exit 1; fi
4040
echo "apt-get attempt $attempt failed; retrying in 30s"; sleep 30
4141
done
4242
- name: Display Conda Environment Versions

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
# Retried with a per-attempt timeout: a stalled Ubuntu mirror otherwise
4343
# hangs this step for hours (two 358-minute hangs on 2026-08-18).
4444
pkgs="texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-xetex latexmk xindy dvipng cm-super"
45-
for attempt in 1 2 3; do
46-
timeout 9m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
47-
if [ "$attempt" = 3 ]; then echo "apt-get failed after 3 attempts"; exit 1; fi
45+
for attempt in 1 2; do
46+
timeout 14m sudo bash -c "apt-get -qq update && apt-get install -y $pkgs" && break
47+
if [ "$attempt" = 2 ]; then echo "apt-get failed after 2 attempts"; exit 1; fi
4848
echo "apt-get attempt $attempt failed; retrying in 30s"; sleep 30
4949
done
5050
- name: Display Conda Environment Versions

0 commit comments

Comments
 (0)