Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--.github/workflows/build.yml29
1 files changed, 26 insertions, 3 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 21bb51b2..f712a531 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -10,6 +10,8 @@ on:
env:
MSRV: "1.76"
+ # This key can be changed to bust the cache of tree-sitter grammars.
+ GRAMMAR_CACHE_VERSION: ""
jobs:
check:
@@ -29,6 +31,13 @@ jobs:
with:
shared-key: "build"
+ - name: Cache tree-sitter grammars
+ uses: actions/cache@v4
+ with:
+ path: runtime/grammars
+ key: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
+ restore-keys: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
+
- name: Run cargo check
run: cargo check
@@ -52,12 +61,12 @@ jobs:
with:
shared-key: "build"
- - name: Cache test tree-sitter grammar
+ - name: Cache tree-sitter grammars
uses: actions/cache@v4
with:
path: runtime/grammars
- key: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
- restore-keys: ${{ runner.os }}-stable-v${{ env.CACHE_VERSION }}-tree-sitter-grammars-
+ key: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
+ restore-keys: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
- name: Run cargo test
run: cargo test --workspace
@@ -87,6 +96,13 @@ jobs:
with:
shared-key: "build"
+ - name: Cache tree-sitter grammars
+ uses: actions/cache@v4
+ with:
+ path: runtime/grammars
+ key: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
+ restore-keys: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
+
- name: Run cargo fmt
run: cargo fmt --all --check
@@ -115,6 +131,13 @@ jobs:
with:
shared-key: "build"
+ - name: Cache tree-sitter grammars
+ uses: actions/cache@v4
+ with:
+ path: runtime/grammars
+ key: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-${{ hashFiles('languages.toml') }}
+ restore-keys: ${{ runner.os }}-stable-v${{ env.GRAMMAR_CACHE_VERSION }}-tree-sitter-grammars-
+
- name: Validate queries
run: cargo xtask query-check