
name: 'setup_cache'
description: 'sets up the shared cache'
inputs:
  compiler:
    required: true
    type: string
  build_type:
    required: true
    type: string
  generator:
    required: true
    type: string
  developer_mode:
    required: true
    type: string


runs:
  using: "composite"
  steps:
    - name: Cache
      uses: actions/cache@v2
      with:
        # You might want to add .ccache to your cache configuration?
        path: |
          ~/vcpkg
          ./build/vcpkg_installed
          ${{ env.CONAN_USER_HOME }}
          ~/.cache/pip
          ${{ env.HOME }}/.cache/vcpkg/archives
          ${{ env.XDG_CACHE_HOME }}/vcpkg/archives
          ${{ env.LOCALAPPDATA }}\vcpkg\archives
          ${{ env.APPDATA }}\vcpkg\archives
        key: ${{ runner.os }}-${{ inputs.compiler }}-${{ inputs.build_type }}-${{ hashFiles('./conanfile.txt')}}-${{ inputs.generator }}-${{ inputs.developer_mode }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ hashFiles('./vcpkg.json')}}
        restore-keys: |
          ${{ runner.os }}-${{ inputs.compiler }}-${{ inputs.build_type }}-${{ hashFiles('./conanfile.txt') }}

