moonrepo / setup-rust

A maintained GitHub action for setting up Rust and Cargo.
84 stars 6 forks source link

Use GITHUB_WORKFLOW to generate cache key #15

Closed mlga closed 8 months ago

mlga commented 8 months ago

While utilizing "Reusable Workflows", using GITHUB_JOB env variable alone is not sufficient. Across all the child workflows which call a reusable workflow,GITHUB_JOB will contain the same name.

Since this pattern is often used in monorepos hosting multiple services or libraries with independent dependencies, cache should be generated per-workflow as well.

In typical use case of having completely separated workflow definitions, the cache is also guaranteed not to be shared across workflows (even if job ID is duplicated intentionally or by accident).

milesj commented 8 months ago

Good callout.