fix(pontryagin): haar typo and cleanup #368
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Napkin CI | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["*"] | |
permissions: | |
contents: read | |
jobs: | |
spellcheck: | |
runs-on: ubuntu-latest | |
name: "Spellcheck" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade codespell | |
- name: Run spellcheck | |
run: | | |
codespell $(git ls-files '*.tex') | |
build: | |
runs-on: ubuntu-latest | |
name: "Compile document" | |
permissions: | |
actions: write | |
steps: | |
- name: Set up Git repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Install TeX Live | |
run: | | |
sudo apt update | |
sudo apt install -y biber texlive-base texlive-latex-recommended texlive-latex-extra texlive-science | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install more packages | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: | | |
latexmk asymptote ghostscript qpdf | |
- name: Restore cache | |
uses: actions/cache/restore@v4 | |
with: | |
key: "napkin-cache" | |
path: | | |
**/*.aux | |
**/*.out | |
Napkin.bbl | |
Napkin.bcf | |
Napkin.blg | |
Napkin.fdb_latexmk | |
Napkin.fls | |
Napkin.log | |
Napkin.maf | |
Napkin.mtc | |
Napkin.mtc0 | |
Napkin.pre | |
Napkin.ptc* | |
Napkin.run.xml | |
Napkin.synctex.gz | |
Napkin.toc | |
asy/Napkin-*.asy | |
asy/Napkin-*.pdf | |
- name: Compile document | |
run: latexmk -pdflatex -interaction=nonstopmode -file-line-error Napkin.tex | |
- name: Save cache | |
uses: actions/cache/save@v4 | |
with: | |
key: "napkin-cache" | |
path: | | |
**/*.aux | |
**/*.out | |
Napkin.bbl | |
Napkin.bcf | |
Napkin.blg | |
Napkin.fdb_latexmk | |
Napkin.fls | |
Napkin.log | |
Napkin.maf | |
Napkin.mtc | |
Napkin.mtc0 | |
Napkin.pre | |
Napkin.ptc* | |
Napkin.run.xml | |
Napkin.synctex.gz | |
Napkin.toc | |
asy/Napkin-*.asy | |
asy/Napkin-*.pdf | |
- name: Compile flowchart | |
run: | | |
./export-flowchart.sh | |
- name: Extract table of contents | |
run: | | |
python3 print-toc.py --parts --chapters --numbers > toc.txt | |
- name: Extract per-part PDF's | |
run: | | |
python3 print-toc.py --qpdf | bash | |
- name: Create dist folder | |
run: | | |
mkdir -p dist | |
mkdir -p dist/figures | |
mkdir -p dist/Parts/ | |
cp Napkin.log dist/ | |
cp Napkin.pdf dist/ | |
cp asy/*.asy dist/figures/ | |
cp asy/*.pdf dist/figures/ | |
cp cover-art.png dist/ | |
cp cover-art.jpg dist/ | |
mv flowchart.png dist/ | |
mv toc.txt dist/ | |
mv part-*.pdf dist/Parts | |
cd dist | |
tree -H '.' -I "index.html" -D --charset utf-8 --filesfirst -T "An Infinitely Large Napkin: All Generated Files" >index.html | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
- name: Upload PDF artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
path: Napkin.pdf | |
name: Napkin.pdf | |
- name: Upload Pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: dist/ | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' | |
name: "Deploy to GitHub Pages" | |
needs: build | |
permissions: | |
actions: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |