Back to Sccache

GitHub Actions

docs/GHA.md

0.16.01.0 KB
Original Source

GitHub Actions

To use the GitHub Actions cache, you need to set SCCACHE_GHA_ENABLED to on to enable it.

By changing SCCACHE_GHA_VERSION, we can purge all the cache.

This cache type will need tokens like ACTIONS_RESULTS_URL and ACTIONS_RUNTIME_TOKEN to work. You can set these environmental variables using the following step in a GitHub Actions workflow.

yaml
- name: Configure sccache
  uses: actions/github-script@v7
  with:
    script: |
      core.exportVariable('ACTIONS_RESULTS_URL', process.env.ACTIONS_RESULTS_URL || '');
      core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

The SCCACHE_GHA_RW_MODE environment variable can be set to READ_ONLY to make sccache use this backend in read-only mode. The default is READ_WRITE.

Behavior

In case sccache reaches the rate limit of the service, the build will continue, but the storage might not be performed.