Skip to content

Commit d84b0a1

Browse files
authored
Cache Migration: Global Conda & LaTeX Caching (#3)
* Migrate cache.yml to use composite actions with global caching Changes: - Use setup-lecture-env@main for Conda environment (global cache) - Use setup-latex@main for LaTeX packages (global cache) - Use build-lectures@main for Jupyter Book builds - Add latex-requirements.txt with version pinning - Add push:branches:[main] trigger for golden cache creation This establishes the global caching infrastructure: - Conda cache: shared across all workflows - LaTeX cache: shared across all workflows - Version-pinned LaTeX packages for explicit invalidation * Fix latex-requirements.txt formatting (remove duplicates) * Remove push trigger from cache.yml - use weekly schedule only Long-running cache builds should only run: - Weekly on schedule (Monday 3am) - Manual dispatch when needed - Not on every main push (dependencies change rarely) * Update latex-requirements.txt * Disable Google Colab workflow for testing phase Renamed collab.yml to collab.yml.disabled to prevent execution during cache migration testing
1 parent 3e1c57d commit d84b0a1

File tree

3 files changed

+43
-24
lines changed

3 files changed

+43
-24
lines changed

.github/workflows/cache.yml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,39 @@ jobs:
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v5
13-
- name: Setup Anaconda
14-
uses: conda-incubator/setup-miniconda@v3
13+
14+
# Use composite action for environment setup
15+
- name: Setup Lecture Environment
16+
uses: quantecon/actions/setup-lecture-env@main
1517
with:
16-
auto-update-conda: true
17-
auto-activate-base: true
18-
miniconda-version: 'latest'
19-
python-version: "3.13"
20-
environment-file: environment.yml
21-
activate-environment: quantecon
18+
python-version: '3.13'
19+
environment-file: 'environment.yml'
20+
environment-name: 'quantecon'
21+
2222
- name: graphviz Support # TODO: required?
2323
run: |
2424
sudo apt-get -qq update && sudo apt-get install -y graphviz
25-
- name: Install latex dependencies
26-
run: |
27-
sudo apt-get -qq update
28-
sudo apt-get install -y \
29-
texlive-latex-recommended \
30-
texlive-latex-extra \
31-
texlive-fonts-recommended \
32-
texlive-fonts-extra \
33-
texlive-xetex \
34-
latexmk \
35-
xindy \
36-
dvipng \
37-
cm-super
25+
26+
# Use composite action for LaTeX setup
27+
- name: Install LaTeX Dependencies
28+
uses: quantecon/actions/setup-latex@main
29+
30+
# Use composite action for building
3831
- name: Build HTML
39-
shell: bash -l {0}
40-
run: |
41-
jb build lectures --path-output ./ -W --keep-going
32+
id: build
33+
uses: quantecon/actions/build-lectures@main
34+
with:
35+
builder: 'html'
36+
source-dir: 'lectures'
37+
extra-args: '-W --keep-going'
38+
4239
- name: Upload Execution Reports (HTML)
4340
uses: actions/upload-artifact@v5
4441
if: failure()
4542
with:
4643
name: execution-reports
4744
path: _build/html/reports
45+
4846
- name: Upload "_build" folder (cache)
4947
uses: actions/upload-artifact@v5
5048
with:
File renamed without changes.

latex-requirements.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# LaTeX packages required for Jupyter Book PDF builds
2+
# Version pinning ensures reproducibility and explicit cache invalidation
3+
# Last updated: 2025-11-07
4+
# TexLive: 2023 (Ubuntu 24.04 LTS Noble ships with 2023.20240207-1)
5+
# Reference: https://packages.ubuntu.com/noble/texlive-base
6+
7+
# Core LaTeX distribution (TexLive 2023)
8+
texlive-latex-recommended=2023.20240207-1
9+
texlive-latex-extra=2023.20240207-1
10+
texlive-fonts-recommended=2023.20240207-1
11+
texlive-fonts-extra=2023.20240207-1
12+
texlive-xetex=2023.20240207-1
13+
texlive-luatex=2023.20240207-1
14+
15+
# Build tools
16+
# Note: Versions will be determined on first run
17+
latexmk
18+
xindy
19+
dvipng
20+
ghostscript
21+
cm-super

0 commit comments

Comments
 (0)