GitHub Action
Sccache Action
The sccache action can be used in GitHub Actions workflows to integrate sccache into the build process. The sccache action is a step in a workflow that can be used to cache compilation results for subsequent builds, reducing the build time and speeding up the overall development process.
sccache can easily use GitHub actions cache with almost no configuration.
This action is available on: https://github.com/marketplace/actions/sccache-action
Just copy and paste the following in your GitHub action:
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
with:
version: "v0.4.0"
Note that using the previous declaration will automatically create a
Post Run sccache-cache
task.
- name: Run sccache stat for check
shell: bash
run: ${SCCACHE_PATH} --show-stats
For Rust code, the following environment variables should be set:
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
For C/C++ code, the following environment variables should be set:
env:
SCCACHE_GHA_ENABLED: "true"
With cmake, add the following argument:
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
With configure, call it with:
# With gcc
./configure CC="sccache gcc" CXX=scache gcc"
# With clang
./configure CC="sccache clang" CXX=scache clang"
- Update the example in README.md
- Update version in
package.json
- Run
npm i --package-lock-only
- Tag a new release
Apache-2.0 (just like sccache)