Skip to content

Commit

Permalink
Merge pull request #7 from ImperialCollegeLondon/unify-ci
Browse files Browse the repository at this point in the history
Build both PDF and web in texlive-action
  • Loading branch information
utensil authored Dec 2, 2023
2 parents 02a3c43 + 2c51339 commit ed1ff5f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 26 deletions.
24 changes: 5 additions & 19 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,20 @@ jobs:
python-version: '3.9'
cache: 'pip' # caching pip dependencies

- 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: |
pip install -r blueprint/requirements.txt
- name: Build blueprint PDF
- name: Build blueprint
uses: xu-cheng/texlive-action@v2
with:
scheme: full
run: |
apk update
apk add --update make py3-pip git
apk add --update make py3-pip git pkgconfig graphviz graphviz-dev gcc musl-dev
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 pygraphviz --global-option=build_ext --global-option="-L/usr/lib/graphviz/" --global-option="-R/usr/lib/graphviz/"
pip install -r requirements.txt
python3 -m pip install invoke
inv bp
- name: Build blueprint website and copy blueprint to `docs/blueprint`
run: |
inv web
inv copy
inv all
- name: Copy Lean documentation to `docs/docs`
run: |
Expand Down
3 changes: 2 additions & 1 deletion blueprint/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
invoke==1.7.1
# https://github.com/pyinvoke/invoke/issues/891
invoke==2.2.0
plasTeX @ git+https://github.com/plastex/plastex.git
leanblueprint @ git+https://github.com/utensil/leanblueprint.git@lean4-only-dev
watchfiles==0.16.1
8 changes: 2 additions & 6 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@
ROOT = Path(__file__).parent
BP_DIR = ROOT/'blueprint'

@task
def copy(ctx):
@task(bp, web)
def all(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 ed1ff5f

Please sign in to comment.