Skip to content

Commit

Permalink
Attempt to generate fewer PDFs (#311)
Browse files Browse the repository at this point in the history
Fixes bountonw/translate-tooling#46. This
should handle both limiting the number of jobs run to only those with
changed files (unless the `.tooling` changes, in which case it runs
everything), and it also adds support for running Make tasks in parallel
(bountonw/translate-tooling#51). The latter
improvement reduces all generation time significantly. For example, the
LBF PDF generation time is around 50% less.
  • Loading branch information
mattleff authored Jun 10, 2024
1 parent c18c63d commit 1041f67
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 5 deletions.
40 changes: 38 additions & 2 deletions .github/workflows/generate-icml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,46 @@ defaults:
shell: bash

jobs:
changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
outputs:
# Expose matched filters as job 'books' output variable
books: ${{ steps.filter.outputs.changes }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
th/PP/PP1:
- 'th/PP/PP1/**'
- .tooling
th/PP/PP2:
- 'th/PP/PP2/**'
- .tooling
th/PP/PP3:
- 'th/PP/PP3/**'
- .tooling
th/PP/PP4:
- 'th/PP/PP4/**'
- .tooling
th/PP/PP5:
- 'th/PP/PP5/**'
- .tooling
th/MB:
- 'th/MB/**'
- .tooling
th/LBF:
- 'th/LBF/**'
- .tooling
generate-icmls:
needs: changes
strategy:
matrix:
book: ['th/PP/PP1', 'th/PP/PP2', 'th/PP/PP3', 'th/PP/PP4','th/PP/PP5', 'th/MB', 'th/LBF']
book: ${{ contains('main', github.ref_name) && '["th/PP/PP1", "th/PP/PP2", "th/PP/PP3", "th/PP/PP4", "th/PP/PP5", "th/LBF", "th/MB"]' || fromJSON(needs.changes.outputs.books) }}
runs-on: ubuntu-20.04
container:
image: mattleff/xelatex-swath
Expand All @@ -36,7 +72,7 @@ jobs:
submodules: 'recursive'
- name: Generate ICMLs
working-directory: ./.tooling/latex/
run: ./generate-icmls.sh ${{ matrix.book }}
run: make -j 4 icmls/${{ matrix.book }}
# Dynamically set the name for the artifact based on the current time and build scope
- name: Set Env
run: |
Expand Down
40 changes: 38 additions & 2 deletions .github/workflows/generate-pdfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,46 @@ defaults:
shell: bash

jobs:
changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
outputs:
# Expose matched filters as job 'books' output variable
books: ${{ steps.filter.outputs.changes }}
steps:
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
th/PP/PP1:
- 'th/PP/PP1/**'
- .tooling
th/PP/PP2:
- 'th/PP/PP2/**'
- .tooling
th/PP/PP3:
- 'th/PP/PP3/**'
- .tooling
th/PP/PP4:
- 'th/PP/PP4/**'
- .tooling
th/PP/PP5:
- 'th/PP/PP5/**'
- .tooling
th/MB:
- 'th/MB/**'
- .tooling
th/LBF:
- 'th/LBF/**'
- .tooling
generate-pdfs:
needs: changes
strategy:
matrix:
book: ['th/PP/PP1', 'th/PP/PP2', 'th/PP/PP3', 'th/PP/PP4','th/PP/PP5', 'th/MB', 'th/LBF']
book: ${{ contains('main', github.ref_name) && '["th/PP/PP1", "th/PP/PP2", "th/PP/PP3", "th/PP/PP4", "th/PP/PP5", "th/LBF", "th/MB"]' || fromJSON(needs.changes.outputs.books) }}
runs-on: ubuntu-20.04
container:
image: mattleff/xelatex-swath
Expand All @@ -36,7 +72,7 @@ jobs:
submodules: 'recursive'
- name: Run Make
working-directory: ./.tooling/latex/
run: ./draft.sh ${{ matrix.book }}
run: make -j 4 pdfs/${{ matrix.book }}
# Dynamically set the name for the artifact based on the current time and build scope
- name: Set Env
run: |
Expand Down
2 changes: 1 addition & 1 deletion .tooling

0 comments on commit 1041f67

Please sign in to comment.