Skip to content

Commit

Permalink
Upgrade to ccache 4.8 and make version configurable (#12)
Browse files Browse the repository at this point in the history
* Add ccache version flag and default to 4.8

* Use the ccache version on github's path
  • Loading branch information
mkruskal-google authored May 3, 2023
1 parent 3258f69 commit 3dc0599
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions ccache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ inputs:
default: '2019'
description: The version of Visual Studio to use (Windows only)
type: string
ccache-version:
required: false
default: '4.8'
description: A pinned version of ccache
type: string

runs:
using: 'composite'
Expand All @@ -38,6 +43,17 @@ runs:
shell: bash
run: ln -fs $GH_ACTION_DIR $GH_ACTION_CLONE

- name: Setup ccache on Windows
if: ${{ runner.os == 'Windows' }}
uses: ./../../_actions/current/internal/ccache-setup-windows
with:
ccache-version: ${{ inputs.ccache-version }}
vsversion: ${{ inputs.vsversion }}
- name: Setup ccache on Mac
if: ${{ runner.os == 'macOS' }}
shell: bash
run: brew install ccache

- name: Configure ccache environment variables
shell: bash
run: |
Expand All @@ -48,17 +64,7 @@ runs:
echo "CCACHE_MAXSIZE=100M" >> $GITHUB_ENV
echo "CCACHE_SLOPPINESS=clang_index_store,include_file_ctime,include_file_mtime,file_macro,time_macros" >> $GITHUB_ENV
echo "CCACHE_DIRECT=true" >> $GITHUB_ENV
echo "CCACHE_CMAKE_FLAGS=-Dprotobuf_ALLOW_CCACHE=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache" >> $GITHUB_ENV
- name: Setup ccache on Windows
if: ${{ runner.os == 'Windows' }}
uses: ./../../_actions/current/internal/ccache-setup-windows
with:
vsversion: ${{ inputs.vsversion }}
- name: Setup ccache on Mac
if: ${{ runner.os == 'macOS' }}
shell: bash
run: brew install ccache
echo "CCACHE_CMAKE_FLAGS=-Dprotobuf_ALLOW_CCACHE=ON -DCMAKE_C_COMPILER_LAUNCHER=$(which ccache) -DCMAKE_CXX_COMPILER_LAUNCHER=$(which ccache)" >> $GITHUB_ENV
- name: Setup fixed path ccache caching
uses: actions/cache@627f0f41f6904a5b1efbaed9f96d9eb58e92e920 # v3.2.4
Expand Down

0 comments on commit 3dc0599

Please sign in to comment.