awslabs / coldsnap

A command line interface for Amazon EBS snapshots
Apache License 2.0
194 stars 24 forks source link

Speed up checks with caching and build matrices #80

Closed jpculp closed 3 years ago

jpculp commented 3 years ago

Description of changes:

This commit refactors the GitHub Actions workflow by taking advantage of build matrices and cached artifacts.

The cache is keyed off of Cargo.lock, but includes a partial key restore so a cache is still used even when Cargo.lock changes. It will then create a new cache for future builds of the same Cargo.lock.

A file named cache_bust is added to the .github folder. Any edit to that file will cause a complete cache miss. We can use this to start over if we ever run into trouble.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

jpculp commented 3 years ago

This is an alternative to my other PR (#76) which only cached the cargo-deny binary.

jpculp commented 3 years ago

Minimum actions duration: Before adding the license check: ~ 3m 46s After adding the license check: ~ 6m 22s This PR when utilizing fully cached artifacts: ~ 38s

jpculp commented 3 years ago

This latest push is a simplified version that is a little less parallel, but easier to follow. The first time it generates cached artifacts is a bit slower than before, but subsequent PR and push workflows should be very quick.

First iteration of PR when utilizing fully cached artifacts: ~ 38s This simplified iteration when utilizing fully cached artifacts: ~ 50s

jpculp commented 3 years ago

Added the logic to skip workflow on markdown changes for push (merge) as well.

jpculp commented 3 years ago

Rebased.