Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up the CI by caching #42

Merged
merged 16 commits into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions .github/workflows/compile.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: generate showcase
name: generate the documentation (and the showcases)
'on':
push:
branches:
Expand All @@ -10,29 +10,38 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
lfs: true
submodules: true
- name: Setup Python environment for sltx
uses: actions/setup-python@v2
# https://github.com/actions/cache/issues/342
- name: Caching
id: cache-documentation
uses: actions/cache@v3
with:
python-version: '3.8'
- name: Setup and run sltx-install (and pu)
run: |
sudo apt install poppler-utils
pip install six sltx
echo "tx-default" | sltx docker
- name: 'Compile the documents and generate previews'
path: |
build
sub_*
key: ${{ runner.os }}-pengu-cache-doc-${{ github.run_id }}
restore-keys: ${{ runner.os }}-pengu-cache-doc-
- name: Install PU for previews
run: sudo apt install poppler-utils
- name: Compile the Documentation, showcase and minimal
uses: xu-cheng/latex-action@v2
with:
root_file: |
documentation.tex
showcase.tex
minimal.tex
- name: 'Generate previews'
run: |
sltx compile --root --profile "tx-default" "showcase" "minimal" "documentation"
pdftoppm -png -r 300 -f 1 -l 1 ./showcase.pdf preview
pdftoppm -png -r 300 -f 1 -l 1 ./minimal.pdf minimal
pdftoppm -png -r 300 -f 1 -l 1 ./build/showcase.pdf preview
pdftoppm -png -r 300 -f 1 -l 1 ./build/minimal.pdf minimal
- name: Commit
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add -f "showcase.pdf" "minimal.pdf" "documentation.pdf" "preview-1.png" "minimal-1.png"
git add -f "build/showcase.pdf" "build/minimal.pdf" "build/documentation.pdf" "preview-1.png" "minimal-1.png"
git commit -m "Newly compiled data"
- name: Push changes
uses: ad-m/github-push-action@master
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/status_check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: status check compile (does not push)
'on':
push:
branches-ignore:
- master
- main
pull_request:
types:
- opened
- edited
- synchronize

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout git repository
uses: actions/checkout@v3
with:
lfs: true
submodules: true
# https://github.com/actions/cache/issues/342
- name: Caching
id: cache-documentation
uses: actions/cache@v3
with:
path: |
build
sub_*
key: ${{ runner.os }}-pengu-cache-doc-${{ github.run_id }}
restore-keys: ${{ runner.os }}-pengu-cache-doc-
- name: Compile the Documentation, showcase and minimal
uses: xu-cheng/latex-action@v2
with:
root_file: |
documentation.tex
showcase.tex
minimal.tex
- uses: actions/upload-artifact@v3
with:
name: status-artifact
path: |
build/minimal.pdf
build/showcase.pdf
build/documentation.pdf
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# tikzpingus

This is work in progress!
See the evolving [documentation](https://media.githubusercontent.com/media/EagleoutIce/tikzpingus/gh-pages/documentation.pdf).
See the evolving [documentation](https://media.githubusercontent.com/media/EagleoutIce/tikzpingus/gh-pages/build/documentation.pdf).

[<img src="https://github.com/EagleoutIce/tikzpingus/blob/gh-pages/preview-1.png?raw=true" width="600"/>](https://media.githubusercontent.com/media/EagleoutIce/tikzpingus/gh-pages/showcase.pdf)
[<img src="https://github.com/EagleoutIce/tikzpingus/blob/gh-pages/preview-1.png?raw=true" width="600"/>](https://media.githubusercontent.com/media/EagleoutIce/tikzpingus/gh-pages/build/showcase.pdf)

[<img src="https://github.com/EagleoutIce/tikzpingus/blob/gh-pages/minimal-1.png?raw=true" width="300"/>](https://media.githubusercontent.com/media/EagleoutIce/tikzpingus/gh-pages/minimal.pdf)
[<img src="https://github.com/EagleoutIce/tikzpingus/blob/gh-pages/minimal-1.png?raw=true" width="300"/>](https://media.githubusercontent.com/media/EagleoutIce/tikzpingus/gh-pages/build/minimal.pdf)