Skip to content

A github action to speedup C++ cmake builds using ccache

License

Notifications You must be signed in to change notification settings

chirag-droid/setup-ccache

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

setup-ccache status

Cache your compile builds using ccache

Use this action to make your cmake builds faster. The caching is done using ccache - a compiler cache.

ccache doesn't currenly support MSVC. ccache is working on support for MSVC

Example workflow using ccache

jobs:
  build:
    steps:
    - name: Setup ccache
      uses: chirag-droid/setup-ccache@latest
      with:
        # default - ccache-key
        key: 'ccache-example-key'

    - name: Build with cmake
      uses: lukka/run-cmake@v1
      with:
        cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
        cmakeAppendedArgs: '-D CMAKE_C_COMPILER_LAUNCHER=ccache -D CMAKE_CXX_COMPILER_LAUNCHER=ccache'
        buildWithCMake: true
        buildDirectory: '${{ github.workspace }}/build'