jianmingyong/ccache action
Install ccache and handle caching from GH
View on GitHubTrust Signals
- Scorecard Score
- not yet scored
- Maintenance Recency
- Activelast commit Mar 24, 2026
- License
- MIT
Pinned Snippet
uses: jianmingyong/ccache-action@c31f64380632d9caeed1385ac306c556c02325a8 # v1.4.0tags can be moved; commit SHAs can't. why a SHA?
Inputs
| name | description | required | default |
|---|---|---|---|
| path | Location where ccache repository will be cloned if ccache is set to install. This has to be relative to github.workspace. (string) | — | ccache |
| version | Target ccache version to install. Follows the semver range specification. Defaults to latest version. (string) | — | * |
| install | Whether to install ccache first. (boolean) | — | true |
| install-type | Installation type: binary or source. By using binary, it will download from GH Releases instead of compiling from source. If binary is not available, it will fall back to source. (string: binary | source) | — | binary |
| ccache-binary-key-prefix | Target key prefix to use for restoring/saving ccache binary. It will append the prefix with os, arch, and version to form the key. | — | ccache_binary |
| ccache-key-prefix | Target key prefix to use for restoring/saving ccache caches. You will need to have different prefix per matrix to avoid potential cache issues. | — | ccache_cache |
| save-cache-once-per-key | If true, the action will only save cache once per ccache-key-prefix. You will have to manually delete the cache in order for it to save again. | — | false |
| gh-token | GH token for purging old cache. If this is empty, it will not do the purge stage. Required "Actions" repository permissions (write). | — | ${{ github.token }} |
| cache-dir | This option specifies where ccache will keep its cached compiler outputs. | — | .ccache |
| compiler-check | By default, ccache includes the modification time (“mtime”) and size of the compiler in the hash to ensure that results retrieved from the cache are accurate. If compiler plugins are used, these plugins will also be added to the hash. This option can be used to select another strategy. | — | mtime |
| compression | If true, ccache will compress data it puts in the cache. However, this option has no effect on how files are retrieved from the cache; compressed and uncompressed results will still be usable regardless of this option. The default is true. Compression is done using the Zstandard algorithm. The algorithm is fast enough that there should be little reason to turn off compression to gain performance. One exception is if the cache is located on a compressed file system, in which case the compression performed by ccache of course is redundant. | — | true |
| compression-level | This option determines the level at which ccache will compress object files using the real-time compression algorithm Zstandard. It only has effect if compression is enabled (which it is by default). Zstandard is extremely fast for decompression and very fast for compression for lower compression levels. The default is 0. | — | 0 |
| max-files | This option specifies the maximum number of files to keep in the cache. Use 0 for no limit (which is the default). | — | 0 |
| max-size | This option specifies the maximum size of the cache. Use 0 for no limit. The default value is 5G. Available suffixes: k, M, G, T (decimal) and Ki, Mi, Gi, Ti (binary). The default suffix is G. | — | 500M |
| sloppiness | By default, ccache tries to give as few false cache hits as possible. However, in certain situations it's possible that you know things that ccache can't take for granted. This option makes it possible to tell ccache to relax some checks in order to increase the hit rate. | — | time_macros |
Outputs
| name | description |
|---|---|
| ccache-binary-path | The location where Ccache file is stored. Example: $input.path/install/bin/ccache.exe |
| ccache-version | The version of Ccache being installed in semver format. |