tree-sitter/.github/actions/cache/action.yml
dundargoc d4067a6ae6 ci: cache fixtures
Only generate fixtures if any grammar from any parser or the parser
generation itself has changed.
2024-02-18 23:08:24 +01:00

25 lines
766 B
YAML

name: 'Cache'
description: "This action caches fixtures"
outputs:
cache-hit:
description: 'Cache hit'
value: ${{ steps.cache_output.outputs.cache-hit }}
runs:
using: "composite"
steps:
- uses: actions/cache@v4
id: cache_fixtures
with:
path: |
test/fixtures/grammars
target/release/tree-sitter-*.wasm
key: fixtures-${{ join(matrix.*, '_') }}-${{ hashFiles(
'.github/workflows/builds.yml',
'.github/workflows/sanitize.yml',
'cli/src/generate/**',
'script/generate-fixtures*',
'test/fixtures/grammars/*/**/src/*.c') }}
- run: echo "cache-hit=${{ steps.cache_fixtures.outputs.cache-hit }}" >> $GITHUB_OUTPUT
shell: bash
id: cache_output