action.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. name: 'Cache'
  2. description: "This action caches neovim dependencies"
  3. runs:
  4. using: "composite"
  5. steps:
  6. - run: echo "CACHE_KEY=${{ github.workflow }}" >> $GITHUB_ENV
  7. shell: bash
  8. - run: echo "CACHE_KEY=${{ github.job }}" >> $GITHUB_ENV
  9. shell: bash
  10. - if: ${{ matrix }}
  11. run: echo "CACHE_KEY=$CACHE_KEY-${{ join(matrix.*, '-') }}" >> $GITHUB_ENV
  12. shell: bash
  13. - if: ${{ matrix.build }}
  14. run: echo "CACHE_KEY=$CACHE_KEY-${{ join(matrix.build.*, '-') }}" >> $GITHUB_ENV
  15. shell: bash
  16. - id: image
  17. run: echo "version=$ImageVersion" >> $GITHUB_OUTPUT
  18. shell: bash
  19. # Avoid using '**/CMakeLists.txt' (or any pattern starting with '**/') even
  20. # if it makes the expression below simpler. hashFiles() has a timer that
  21. # will fail the job if it times out, which can happen if there are too many
  22. # files to search through.
  23. - uses: actions/cache@v4
  24. with:
  25. path: .deps
  26. key: ${{ env.CACHE_KEY }}-${{ steps.image.outputs.version }}-${{ hashFiles('cmake**',
  27. '.github/**', 'CMakeLists.txt',
  28. 'runtime/CMakeLists.txt', 'src/nvim/**/CMakeLists.txt') }}