Skip to content

How to update cache when the source code changes ? #240

@iTrooz

Description

@iTrooz

Hey ! I am trying to use this action, but I don't understand how to use it to cache compilation results.

Since github actions cache cannot be updated (actions/cache#342), we rely only on the cache key to be able to "update" the cache. But your cache key does not include the hash of files in the "src/" folder, meaning that any update to the source code will not be reflected in the cache key, will not write a new cache entry, and thus these modified files will not be cached, and will have to be recompiled every time.

One option to avoid that would be to add ${{ hashFiles('src/**') }} as key, but then every time we update the source code, we would lose all cache (dependencies + compilation).

Which brings me to my question: how are we supposed to use this action in a regular Rust project ?
Thank you for your answer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions