Skip to content

Commit

Permalink
[ci][generate_cache] Run steps in parallel (#940)
Browse files Browse the repository at this point in the history
In the shell script that is the main body of the `generate_cache` job,
background each task and then wait for them all to complete so that they
can run in parallel.

In one test, this sped up the execution time of the "Download
dependencies" step of the `generate_cache` job from 29s [1] to 18s [2].

[1] https://github.com/google/zerocopy/actions/runs/8022266381/job/21916187070?pr=932

[2] https://github.com/google/zerocopy/actions/runs/8022379583/job/21916562791?pr=940
  • Loading branch information
joshlf committed Feb 23, 2024
1 parent 022feb4 commit 461bc15
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -408,12 +408,17 @@ jobs:
# there is no support for doing this directly [1], so we just check
# all crates using --tests.
#
# We background all jobs and then wait for them so that they can run
# in parallel.
#
# [1] https://stackoverflow.com/a/42139535/836390
cargo check --workspace --tests &> /dev/null || true
cargo metadata &> /dev/null || true
cargo install cargo-readme --version 3.2.0 &> /dev/null || true
cargo install --locked kani-verifier &> /dev/null || true
cargo kani setup &> /dev/null || true
cargo check --workspace --tests &> /dev/null &
cargo metadata &> /dev/null &
cargo install cargo-readme --version 3.2.0 &> /dev/null &
cargo install --locked kani-verifier &> /dev/null &
cargo kani setup &> /dev/null &
wait
check-all-toolchains-tested:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 461bc15

Please sign in to comment.