hendrikmuhs / ccache-action

github action to speedup building using ccache
MIT License
114 stars 52 forks source link

Provide action output with the ccache path? #101

Open vadz opened 1 year ago

vadz commented 1 year ago

The documentation currently recommends doing

    export PATH="/usr/lib/ccache:/usr/local/opt/ccache/libexec:$PATH"

which works, but seems a bit ugly as we use a directory in the path which doesn't exist on the current platform and not very future-proof as this will stop working when/if GitHub provides CI runners on ARM-based Macs, where we'd have to add /opt/homebrew/opt/ccache/libexec to the path instead. And the not nice thing is that this won't result in an error, but ccache will just silently not be used, until all workflows using this action are updated to use the new path.

So I wonder if it would make sense to have an output in this action with the directory to prepend to the path? It looks like it would be easy to do and I could probably do this myself if you agree that this is a good idea.

Alternatively, and even more conveniently, if also more magically, perhaps the action should just update the PATH on its own? Or is writing to $GITHUB_ENV from an action disallowed?