Skip to content

Speed up publish CI pipeline #2767

Open
@michael-kerscher

Description

@michael-kerscher

Currently a run of the publish pipeline is taking around 30 minutes.

Most of the time is spent in the "build all translation" step.

- name: Build all translations
run: |
for po_lang in ${{ env.LANGUAGES }}; do
.github/workflows/build.sh $po_lang book/$po_lang
mv book/$po_lang/html book/html/$po_lang
done

This is the main loop for building the translations. This is currently writing files into the book/<language>/html folder, then moved into book/html/<language>. The build.sh script is heavily modifying the current state of the repository so this is not trivially parallelized in the same step.

Options:

  • separate steps by using Githubs job matrix to run each translation as a separate job. Note: this requires all other steps in that job to run multiple times which is wasting resources. Installing mdbook in that environment should be cached properly. The English translation should then also be handled like other languages as this is currently a special case.
    • This also needs to take into account that the generated artifacts need to be used in later steps
  • Alternative: Split the translation step into two steps (likely more efficient)
    • (for each language) restore the entire book source as currently and copy all necessary files into a new source/<language>/ directory
    • With all sources in each source/<language> folder, this can be easily parallelized after modifying the build script.

rm -r src/ third_party/
git restore --source "$(git rev-list -n 1 --before "$pot_creation_date" @)" src/ third_party/ book.toml

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions