Skip to content
archive

GitHub Action

Setup ccache (Windows, Linux, MacOs)

v2.1 Latest version

Setup ccache (Windows, Linux, MacOs)

archive

Setup ccache (Windows, Linux, MacOs)

A github action to speedup cmake builds using ccache

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup ccache (Windows, Linux, MacOs)

uses: chirag-droid/setup-ccache@v2.1

Learn more about this action in chirag-droid/setup-ccache

Choose a version

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'