Skip to content

Commit

Permalink
Merge pull request #5 from ImperialCollegeLondon/faster-ci
Browse files Browse the repository at this point in the history
Try accelerating LaTeX building
  • Loading branch information
utensil authored Nov 28, 2023
2 parents 00f6cd4 + d581122 commit 83b442f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
32 changes: 24 additions & 8 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,36 @@ jobs:
python-version: '3.9'
cache: 'pip' # caching pip dependencies

- name: Install blueprint apt dependencies
run: |
sudo apt-get update
sudo apt-get install -y graphviz libgraphviz-dev pdf2svg dvisvgm texlive-full
- name: Install blueprint apt deps with cache
uses: awalsh128/cache-apt-pkgs-action@latest
with:
# texlive-binaries is for kpsewhich, which is a dependency of plastex/blueprint
packages: graphviz libgraphviz-dev pdf2svg dvisvgm texlive-binaries
version: 1.0

- name: Install blueprint dependencies
run: |
cd blueprint && pip install -r requirements.txt
pip install -r blueprint/requirements.txt
- name: Build blueprint and copy to `docs/blueprint`
- name: Build blueprint PDF
uses: xu-cheng/texlive-action@v2
with:
scheme: full
run: |
apk update
apk add --update make py3-pip git
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global --add safe.directory `pwd`
python3 -m pip install --upgrade pip requests wheel
python3 -m pip install invoke
inv bp
- name: Build blueprint website and copy blueprint to `docs/blueprint`
run: |
inv all
inv web
inv copy
- name: Copy documentation to `docs/docs`
- name: Copy Lean documentation to `docs/docs`
run: |
mv .lake/build/doc docs/docs
Expand Down
8 changes: 6 additions & 2 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
ROOT = Path(__file__).parent
BP_DIR = ROOT/'blueprint'

@task(bp, web)
def all(ctx):
@task
def copy(ctx):
shutil.rmtree(ROOT/'docs'/'blueprint', ignore_errors=True)
shutil.copytree(ROOT/'blueprint'/'web', ROOT/'docs'/'blueprint')
shutil.copy2(ROOT/'blueprint'/'print'/'print.pdf', ROOT/'docs'/'blueprint.pdf')

@task(bp, web, copy)
def all(ctx):
pass

@task(web)
def html(ctx):
shutil.rmtree(ROOT/'docs'/'blueprint', ignore_errors=True)
Expand Down

0 comments on commit 83b442f

Please sign in to comment.