action.yml raw

   1  name: 'Restore Caches'
   2  description: 'Restore ccache, depends sources, and built depends caches'
   3  inputs:
   4    provider:
   5      description: 'The cache provider to use'
   6      required: true
   7  runs:
   8    using: 'composite'
   9    steps:
  10      - name: Restore Ccache cache
  11        id: ccache-cache
  12        uses: ./.github/actions/cache/restore/internal
  13        with:
  14          path: ${{ env.CCACHE_DIR }}
  15          key: ccache-${{ env.CONTAINER_NAME }}-${{ github.run_id }}
  16          restore-keys: |
  17            ccache-${{ env.CONTAINER_NAME }}-
  18          provider: ${{ inputs.provider }}
  19  
  20      - name: Restore depends sources cache
  21        id: depends-sources
  22        uses: ./.github/actions/cache/restore/internal
  23        with:
  24          path: ${{ env.SOURCES_PATH }}
  25          key: depends-sources-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
  26          restore-keys: |
  27            depends-sources-${{ env.CONTAINER_NAME }}-
  28          provider: ${{ inputs.provider }}
  29  
  30      - name: Restore built depends cache
  31        id: depends-built
  32        uses: ./.github/actions/cache/restore/internal
  33        with:
  34          path: ${{ env.BASE_CACHE }}
  35          key: depends-built-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }}
  36          restore-keys: |
  37            depends-built-${{ env.CONTAINER_NAME }}-
  38          provider: ${{ inputs.provider }}
  39  
  40      - name: Restore previous releases cache
  41        id: previous-releases
  42        uses: ./.github/actions/cache/restore/internal
  43        with:
  44          path: ${{ env.PREVIOUS_RELEASES_DIR }}
  45          key: previous-releases-${{ env.CONTAINER_NAME }}-${{ env.PREVIOUS_RELEASES_HASH }}
  46          restore-keys: |
  47            previous-releases-${{ env.CONTAINER_NAME }}-
  48          provider: ${{ inputs.provider }}
  49  
  50      - name: export cache hits
  51        shell: bash
  52        run: |
  53          echo "depends-sources-cache-hit=${{ steps.depends-sources.outputs.cache-hit }}" >> $GITHUB_ENV
  54          echo "depends-built-cache-hit=${{ steps.depends-built.outputs.cache-hit }}" >> $GITHUB_ENV
  55          echo "previous-releases-cache-hit=${{ steps.previous-releases.outputs.cache-hit }}" >> $GITHUB_ENV
  56