From 6acccfd82122ba83f2b866360a5c80696c8a52e9 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Mon, 18 May 2026 18:57:17 +0200 Subject: [PATCH 01/10] chore: resolve dependency security alerts --- Cargo.lock | 27 +++++++++++++++++++-------- crates/pgls_workspace/Cargo.toml | 2 +- uv.lock | 18 +++++++++++------- uv.toml | 2 ++ 4 files changed, 33 insertions(+), 16 deletions(-) create mode 100644 uv.toml diff --git a/Cargo.lock b/Cargo.lock index 2b82303bf..4beecbfd4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1163,6 +1163,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "form_urlencoded" version = "1.2.2" @@ -1470,7 +1476,7 @@ checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.1.5", ] [[package]] @@ -1478,6 +1484,11 @@ name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash 0.2.0", +] [[package]] name = "hashlink" @@ -1983,11 +1994,11 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.5" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +checksum = "7f66e8d5d03f609abc3a39e6f08e4164ebf1447a732906d39eb9b99b7919ef39" dependencies = [ - "hashbrown 0.15.5", + "hashbrown 0.16.1", ] [[package]] @@ -3384,9 +3395,9 @@ checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] name = "rand" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a" dependencies = [ "libc", "rand_chacha", @@ -3656,9 +3667,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.9" +version = "0.103.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" dependencies = [ "ring", "rustls-pki-types", diff --git a/crates/pgls_workspace/Cargo.toml b/crates/pgls_workspace/Cargo.toml index 468c07c9f..0f65ac13f 100644 --- a/crates/pgls_workspace/Cargo.toml +++ b/crates/pgls_workspace/Cargo.toml @@ -13,7 +13,7 @@ version = "0.0.0" [dependencies] globset = "0.4.16" -lru = "0.12" +lru = "0.16.3" ignore = { workspace = true } json-strip-comments = { workspace = true } diff --git a/uv.lock b/uv.lock index e40fa998b..2dab5ed84 100644 --- a/uv.lock +++ b/uv.lock @@ -1,7 +1,11 @@ version = 1 -revision = 2 +revision = 3 requires-python = ">=3.13" +[options] +exclude-newer = "0001-01-01T00:00:00Z" # This has no effect and is included for backwards compatibility when using relative exclude-newer values. +exclude-newer-span = "P3D" + [[package]] name = "click" version = "8.1.8" @@ -58,23 +62,23 @@ wheels = [ [[package]] name = "jinja2" -version = "3.1.5" +version = "3.1.6" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "markupsafe" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/af/92/b3130cbbf5591acf9ade8708c365f3238046ac7cb8ccba6e81abccb0ccff/jinja2-3.1.5.tar.gz", hash = "sha256:8fefff8dc3034e27bb80d67c671eb8a9bc424c0ef4c0826edbff304cceff43bb", size = 244674, upload-time = "2024-12-21T18:30:22.828Z" } +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bd/0f/2ba5fbcd631e3e88689309dbe978c5769e883e4b84ebfe7da30b43275c5a/jinja2-3.1.5-py3-none-any.whl", hash = "sha256:aba0f4dc9ed8013c424088f68a5c226f7d6097ed89b246d7749c2ec4175c6adb", size = 134596, upload-time = "2024-12-21T18:30:19.133Z" }, + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, ] [[package]] name = "markdown" -version = "3.7" +version = "3.10.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/54/28/3af612670f82f4c056911fbbbb42760255801b3068c48de792d354ff4472/markdown-3.7.tar.gz", hash = "sha256:2ae2471477cfd02dbbf038d5d9bc226d40def84b4fe2986e49b59b6b472bbed2", size = 357086, upload-time = "2024-08-16T15:55:17.812Z" } +sdist = { url = "https://files.pythonhosted.org/packages/2b/f4/69fa6ed85ae003c2378ffa8f6d2e3234662abd02c10d216c0ba96081a238/markdown-3.10.2.tar.gz", hash = "sha256:994d51325d25ad8aa7ce4ebaec003febcce822c3f8c911e3b17c52f7f589f950", size = 368805, upload-time = "2026-02-09T14:57:26.942Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/3f/08/83871f3c50fc983b88547c196d11cf8c3340e37c32d2e9d6152abe2c61f7/Markdown-3.7-py3-none-any.whl", hash = "sha256:7eb6df5690b81a1d7942992c97fad2938e956e79df20cbc6186e9c3a77b1c803", size = 106349, upload-time = "2024-08-16T15:55:16.176Z" }, + { url = "https://files.pythonhosted.org/packages/de/1f/77fa3081e4f66ca3576c896ae5d31c3002ac6607f9747d2e3aa49227e464/markdown-3.10.2-py3-none-any.whl", hash = "sha256:e91464b71ae3ee7afd3017d9f358ef0baf158fd9a298db92f1d4761133824c36", size = 108180, upload-time = "2026-02-09T14:57:25.787Z" }, ] [[package]] diff --git a/uv.toml b/uv.toml new file mode 100644 index 000000000..d392869cd --- /dev/null +++ b/uv.toml @@ -0,0 +1,2 @@ +# Require newly published package versions to be at least 3 days old before resolution. +exclude-newer = "3d" From c5314b240d9fdcf9039bc86f6e2f0765004c60e0 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Mon, 18 May 2026 19:27:39 +0200 Subject: [PATCH 02/10] ci: stabilize postgres and tree-sitter setup --- .github/actions/setup-postgres/action.yml | 26 +++++++++++++++++------ .github/scripts/setup-tree-sitter.sh | 19 +++++++++++++++++ .github/workflows/pull_request.yml | 8 +++---- .github/workflows/release.yml | 2 +- 4 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 .github/scripts/setup-tree-sitter.sh diff --git a/.github/actions/setup-postgres/action.yml b/.github/actions/setup-postgres/action.yml index a01684c95..f2ba8f77e 100644 --- a/.github/actions/setup-postgres/action.yml +++ b/.github/actions/setup-postgres/action.yml @@ -140,9 +140,21 @@ runs: -e POSTGRES_DB=postgres \ -p 5432:5432 \ postgres-language-server-dev:latest - # Wait for postgres to be ready - for _ in {1..30}; do - if docker exec postgres pg_isready -U postgres; then + # The custom image runs init scripts on first boot. pg_isready can briefly + # succeed while the entrypoint's temporary server is still running, just + # before it shuts down and starts the final server. Wait for that init + # phase to finish before creating extensions in the postgres database. + for _ in {1..60}; do + logs="$(docker logs postgres 2>&1 || true)" + if grep -Eq "PostgreSQL init process complete|Skipping initialization" <<<"${logs}"; then + break + fi + sleep 1 + done + + for _ in {1..60}; do + if docker exec postgres pg_isready -U postgres -d postgres && \ + docker exec postgres psql -U postgres -d postgres -tAc "SELECT 1" >/dev/null; then break fi sleep 1 @@ -151,9 +163,9 @@ runs: # Create extensions in postgres database only (NOT template1) # This avoids polluting test databases - tests that need extensions can create them explicitly echo "Creating extensions in postgres database..." - docker exec postgres psql -U postgres -c "CREATE SCHEMA IF NOT EXISTS extensions;" - docker exec postgres psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS plpgsql_check SCHEMA extensions;" - docker exec postgres psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS pglinter SCHEMA extensions;" + docker exec postgres psql -U postgres -d postgres -c "CREATE SCHEMA IF NOT EXISTS extensions;" + docker exec postgres psql -U postgres -d postgres -c "CREATE EXTENSION IF NOT EXISTS plpgsql_check SCHEMA extensions;" + docker exec postgres psql -U postgres -d postgres -c "CREATE EXTENSION IF NOT EXISTS pglinter SCHEMA extensions;" # Show extension status - docker exec postgres psql -U postgres -c "SELECT extname, extversion FROM pg_extension WHERE extname IN ('plpgsql_check', 'pglinter');" + docker exec postgres psql -U postgres -d postgres -c "SELECT extname, extversion FROM pg_extension WHERE extname IN ('plpgsql_check', 'pglinter');" diff --git a/.github/scripts/setup-tree-sitter.sh b/.github/scripts/setup-tree-sitter.sh new file mode 100644 index 000000000..862108eac --- /dev/null +++ b/.github/scripts/setup-tree-sitter.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -euo pipefail + +if command -v tree-sitter >/dev/null 2>&1; then + tree-sitter --version + exit 0 +fi + +version="$(cat .tree-sitter-cli-version)" + +if [[ "${RUNNER_OS:-}" == "Windows" ]]; then + # Compiling tree-sitter-cli from source on Windows intermittently fails in CI. + # The npm package ships a prebuilt binary for the GitHub-hosted Windows runner. + npm install -g "tree-sitter-cli@${version}" +else + cargo install tree-sitter-cli --version "${version}" --locked +fi + +tree-sitter --version diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index b90dac834..c8eaaad56 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -136,7 +136,7 @@ jobs: key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} - name: Setup tree-sitter - run: command -v tree-sitter || cargo install tree-sitter-cli --version "$(cat .tree-sitter-cli-version)" --locked + run: bash ./.github/scripts/setup-tree-sitter.sh shell: bash - name: Setup sqlx-cli @@ -206,7 +206,7 @@ jobs: key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} - name: Setup tree-sitter - run: command -v tree-sitter || cargo install tree-sitter-cli --version "$(cat .tree-sitter-cli-version)" --locked + run: bash ./.github/scripts/setup-tree-sitter.sh shell: bash - name: Run clippy @@ -247,7 +247,7 @@ jobs: target/**/build/pgls_treesitter_grammar-*/out/generated key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} - name: setup tree-sitter - run: command -v tree-sitter || cargo install tree-sitter-cli --version "$(cat .tree-sitter-cli-version)" --locked + run: bash ./.github/scripts/setup-tree-sitter.sh shell: bash - name: Build main binary run: cargo build -p pgls_cli --release @@ -337,7 +337,7 @@ jobs: target/**/build/pgls_treesitter_grammar-*/out/generated key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} - name: setup tree-sitter - run: command -v tree-sitter || cargo install tree-sitter-cli --version "$(cat .tree-sitter-cli-version)" --locked + run: bash ./.github/scripts/setup-tree-sitter.sh shell: bash - name: Ensure RustFMT on nightly toolchain run: rustup component add rustfmt --toolchain nightly diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2d714f58e..1c46a4fdd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -126,7 +126,7 @@ jobs: key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} - name: Setup tree-sitter - run: command -v tree-sitter || cargo install tree-sitter-cli --version "$(cat .tree-sitter-cli-version)" --locked + run: bash ./.github/scripts/setup-tree-sitter.sh shell: bash - name: Setup Postgres From 14a6fd9fb55833adf6b599dc424e79abb705dd91 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Mon, 18 May 2026 19:39:09 +0200 Subject: [PATCH 03/10] ci: persist tree-sitter path on Windows --- .github/scripts/setup-tree-sitter.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/scripts/setup-tree-sitter.sh b/.github/scripts/setup-tree-sitter.sh index 862108eac..5f58a97f7 100644 --- a/.github/scripts/setup-tree-sitter.sh +++ b/.github/scripts/setup-tree-sitter.sh @@ -16,4 +16,9 @@ else cargo install tree-sitter-cli --version "${version}" --locked fi -tree-sitter --version +tree_sitter_path="$(command -v tree-sitter)" +if [[ -n "${GITHUB_PATH:-}" ]]; then + dirname "${tree_sitter_path}" >>"${GITHUB_PATH}" +fi + +"${tree_sitter_path}" --version From 7d84c00eade05a2e95cb611634ea7fa44e6f94cf Mon Sep 17 00:00:00 2001 From: psteinroe Date: Mon, 18 May 2026 19:55:32 +0200 Subject: [PATCH 04/10] ci: install tree-sitter from prebuilt package --- .github/scripts/setup-tree-sitter.sh | 31 +++++++++++++++++++--------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/.github/scripts/setup-tree-sitter.sh b/.github/scripts/setup-tree-sitter.sh index 5f58a97f7..5fce111ec 100644 --- a/.github/scripts/setup-tree-sitter.sh +++ b/.github/scripts/setup-tree-sitter.sh @@ -1,24 +1,35 @@ #!/usr/bin/env bash set -euo pipefail +persist_tree_sitter_path() { + local tree_sitter_path tree_sitter_dir + tree_sitter_path="$(command -v tree-sitter)" + tree_sitter_dir="$(dirname "${tree_sitter_path}")" + + if [[ -n "${GITHUB_PATH:-}" ]]; then + if [[ "${RUNNER_OS:-}" == "Windows" ]] && command -v cygpath >/dev/null 2>&1; then + cygpath -w "${tree_sitter_dir}" >>"${GITHUB_PATH}" + else + echo "${tree_sitter_dir}" >>"${GITHUB_PATH}" + fi + fi + + "${tree_sitter_path}" --version +} + if command -v tree-sitter >/dev/null 2>&1; then - tree-sitter --version + persist_tree_sitter_path exit 0 fi version="$(cat .tree-sitter-cli-version)" -if [[ "${RUNNER_OS:-}" == "Windows" ]]; then - # Compiling tree-sitter-cli from source on Windows intermittently fails in CI. - # The npm package ships a prebuilt binary for the GitHub-hosted Windows runner. +if command -v npm >/dev/null 2>&1; then + # The npm package ships prebuilt binaries, avoiding slow and flaky source + # compilation on GitHub-hosted runners. npm install -g "tree-sitter-cli@${version}" else cargo install tree-sitter-cli --version "${version}" --locked fi -tree_sitter_path="$(command -v tree-sitter)" -if [[ -n "${GITHUB_PATH:-}" ]]; then - dirname "${tree_sitter_path}" >>"${GITHUB_PATH}" -fi - -"${tree_sitter_path}" --version +persist_tree_sitter_path From b25d737cee2ad21ad5350ac8f6d9b67e71fad27f Mon Sep 17 00:00:00 2001 From: psteinroe Date: Mon, 18 May 2026 20:07:53 +0200 Subject: [PATCH 05/10] ci: expose tree-sitter binary to Rust builds --- .github/scripts/setup-tree-sitter.sh | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/scripts/setup-tree-sitter.sh b/.github/scripts/setup-tree-sitter.sh index 5fce111ec..02cacdf3f 100644 --- a/.github/scripts/setup-tree-sitter.sh +++ b/.github/scripts/setup-tree-sitter.sh @@ -1,19 +1,24 @@ #!/usr/bin/env bash set -euo pipefail -persist_tree_sitter_path() { - local tree_sitter_path tree_sitter_dir - tree_sitter_path="$(command -v tree-sitter)" - tree_sitter_dir="$(dirname "${tree_sitter_path}")" +add_github_path() { + local dir="$1" if [[ -n "${GITHUB_PATH:-}" ]]; then if [[ "${RUNNER_OS:-}" == "Windows" ]] && command -v cygpath >/dev/null 2>&1; then - cygpath -w "${tree_sitter_dir}" >>"${GITHUB_PATH}" + cygpath -w "${dir}" >>"${GITHUB_PATH}" else - echo "${tree_sitter_dir}" >>"${GITHUB_PATH}" + echo "${dir}" >>"${GITHUB_PATH}" fi fi +} + +persist_tree_sitter_path() { + local tree_sitter_path tree_sitter_dir + tree_sitter_path="$(command -v tree-sitter)" + tree_sitter_dir="$(dirname "${tree_sitter_path}")" + add_github_path "${tree_sitter_dir}" "${tree_sitter_path}" --version } @@ -28,6 +33,15 @@ if command -v npm >/dev/null 2>&1; then # The npm package ships prebuilt binaries, avoiding slow and flaky source # compilation on GitHub-hosted runners. npm install -g "tree-sitter-cli@${version}" + + # npm also creates shell shims in the global bin directory. Rust's + # Command::new("tree-sitter") needs the real binary on Windows, so expose the + # package directory that contains tree-sitter.exe/tree-sitter directly. + npm_tree_sitter_dir="$(npm root -g)/tree-sitter-cli" + if [[ -d "${npm_tree_sitter_dir}" ]]; then + export PATH="${npm_tree_sitter_dir}:${PATH}" + add_github_path "${npm_tree_sitter_dir}" + fi else cargo install tree-sitter-cli --version "${version}" --locked fi From aa049170e70fccd296532976b5e50d5845312973 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Mon, 18 May 2026 21:23:08 +0200 Subject: [PATCH 06/10] ci: avoid tree-sitter cache churn --- .github/actions/setup-postgres/action.yml | 22 ++++------------------ .github/workflows/pull_request.yml | 8 ++++---- .github/workflows/release.yml | 2 +- 3 files changed, 9 insertions(+), 23 deletions(-) diff --git a/.github/actions/setup-postgres/action.yml b/.github/actions/setup-postgres/action.yml index f2ba8f77e..ac0c9e1fc 100644 --- a/.github/actions/setup-postgres/action.yml +++ b/.github/actions/setup-postgres/action.yml @@ -140,32 +140,18 @@ runs: -e POSTGRES_DB=postgres \ -p 5432:5432 \ postgres-language-server-dev:latest - # The custom image runs init scripts on first boot. pg_isready can briefly - # succeed while the entrypoint's temporary server is still running, just - # before it shuts down and starts the final server. Wait for that init - # phase to finish before creating extensions in the postgres database. + # The Dockerfile's init script installs the extensions. Wait for init to + # finish so pg_isready doesn't catch the temporary bootstrap server. for _ in {1..60}; do - logs="$(docker logs postgres 2>&1 || true)" - if grep -Eq "PostgreSQL init process complete|Skipping initialization" <<<"${logs}"; then + if docker logs postgres 2>&1 | grep -Eq "PostgreSQL init process complete|Skipping initialization"; then break fi sleep 1 done for _ in {1..60}; do - if docker exec postgres pg_isready -U postgres -d postgres && \ - docker exec postgres psql -U postgres -d postgres -tAc "SELECT 1" >/dev/null; then + if docker exec postgres psql -U postgres -d postgres -tAc "SELECT 1" >/dev/null; then break fi sleep 1 done - - # Create extensions in postgres database only (NOT template1) - # This avoids polluting test databases - tests that need extensions can create them explicitly - echo "Creating extensions in postgres database..." - docker exec postgres psql -U postgres -d postgres -c "CREATE SCHEMA IF NOT EXISTS extensions;" - docker exec postgres psql -U postgres -d postgres -c "CREATE EXTENSION IF NOT EXISTS plpgsql_check SCHEMA extensions;" - docker exec postgres psql -U postgres -d postgres -c "CREATE EXTENSION IF NOT EXISTS pglinter SCHEMA extensions;" - - # Show extension status - docker exec postgres psql -U postgres -d postgres -c "SELECT extname, extversion FROM pg_extension WHERE extname IN ('plpgsql_check', 'pglinter');" diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index c8eaaad56..cd7ad3abf 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -133,7 +133,7 @@ jobs: ~/.cargo/bin/sqlx ~/.cargo/bin/cargo-sqlx target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} + key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: Setup tree-sitter run: bash ./.github/scripts/setup-tree-sitter.sh @@ -203,7 +203,7 @@ jobs: path: | ~/.cargo/bin/tree-sitter target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} + key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: Setup tree-sitter run: bash ./.github/scripts/setup-tree-sitter.sh @@ -245,7 +245,7 @@ jobs: path: | ~/.cargo/bin/tree-sitter target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} + key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: setup tree-sitter run: bash ./.github/scripts/setup-tree-sitter.sh shell: bash @@ -335,7 +335,7 @@ jobs: path: | ~/.cargo/bin/tree-sitter target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} + key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: setup tree-sitter run: bash ./.github/scripts/setup-tree-sitter.sh shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c46a4fdd..6c50d41f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -123,7 +123,7 @@ jobs: path: | ~/.cargo/bin/tree-sitter target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} + key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: Setup tree-sitter run: bash ./.github/scripts/setup-tree-sitter.sh From f117561d53479fcebc655f2f7b39e2fd06d5f614 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Mon, 18 May 2026 23:49:11 +0200 Subject: [PATCH 07/10] ci: install tree-sitter with cargo --- .github/scripts/setup-tree-sitter.sh | 37 ++++++++++++---------------- .github/workflows/pull_request.yml | 12 ++++++--- .github/workflows/release.yml | 3 ++- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.github/scripts/setup-tree-sitter.sh b/.github/scripts/setup-tree-sitter.sh index 02cacdf3f..aa7b9540f 100644 --- a/.github/scripts/setup-tree-sitter.sh +++ b/.github/scripts/setup-tree-sitter.sh @@ -13,6 +13,17 @@ add_github_path() { fi } +cargo_bin_dir() { + local cargo_home="${CARGO_HOME:-$HOME/.cargo}" + local dir="${cargo_home}/bin" + + if [[ "${RUNNER_OS:-}" == "Windows" ]] && command -v cygpath >/dev/null 2>&1; then + cygpath -u "${dir}" + else + echo "${dir}" + fi +} + persist_tree_sitter_path() { local tree_sitter_path tree_sitter_dir tree_sitter_path="$(command -v tree-sitter)" @@ -22,28 +33,12 @@ persist_tree_sitter_path() { "${tree_sitter_path}" --version } -if command -v tree-sitter >/dev/null 2>&1; then - persist_tree_sitter_path - exit 0 -fi +cargo_bin="$(cargo_bin_dir)" +export PATH="${cargo_bin}:${PATH}" +add_github_path "${cargo_bin}" -version="$(cat .tree-sitter-cli-version)" - -if command -v npm >/dev/null 2>&1; then - # The npm package ships prebuilt binaries, avoiding slow and flaky source - # compilation on GitHub-hosted runners. - npm install -g "tree-sitter-cli@${version}" - - # npm also creates shell shims in the global bin directory. Rust's - # Command::new("tree-sitter") needs the real binary on Windows, so expose the - # package directory that contains tree-sitter.exe/tree-sitter directly. - npm_tree_sitter_dir="$(npm root -g)/tree-sitter-cli" - if [[ -d "${npm_tree_sitter_dir}" ]]; then - export PATH="${npm_tree_sitter_dir}:${PATH}" - add_github_path "${npm_tree_sitter_dir}" - fi -else - cargo install tree-sitter-cli --version "${version}" --locked +if ! command -v tree-sitter >/dev/null 2>&1; then + cargo install tree-sitter-cli --version "$(cat .tree-sitter-cli-version)" --locked fi persist_tree_sitter_path diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index cd7ad3abf..d0ee59399 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -130,10 +130,11 @@ jobs: with: path: | ~/.cargo/bin/tree-sitter + ~/.cargo/bin/tree-sitter.exe ~/.cargo/bin/sqlx ~/.cargo/bin/cargo-sqlx target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-cargo-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: Setup tree-sitter run: bash ./.github/scripts/setup-tree-sitter.sh @@ -202,8 +203,9 @@ jobs: with: path: | ~/.cargo/bin/tree-sitter + ~/.cargo/bin/tree-sitter.exe target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-cargo-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: Setup tree-sitter run: bash ./.github/scripts/setup-tree-sitter.sh @@ -244,8 +246,9 @@ jobs: with: path: | ~/.cargo/bin/tree-sitter + ~/.cargo/bin/tree-sitter.exe target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-cargo-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: setup tree-sitter run: bash ./.github/scripts/setup-tree-sitter.sh shell: bash @@ -334,8 +337,9 @@ jobs: with: path: | ~/.cargo/bin/tree-sitter + ~/.cargo/bin/tree-sitter.exe target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-cargo-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: setup tree-sitter run: bash ./.github/scripts/setup-tree-sitter.sh shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c50d41f6..f5a9670d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -122,8 +122,9 @@ jobs: with: path: | ~/.cargo/bin/tree-sitter + ~/.cargo/bin/tree-sitter.exe target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-cargo-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: Setup tree-sitter run: bash ./.github/scripts/setup-tree-sitter.sh From e89c12d1599ea9785f867f06a40d1d640efc7b57 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Fri, 22 May 2026 21:58:51 +0200 Subject: [PATCH 08/10] ci: use tree-sitter setup action --- .github/scripts/setup-tree-sitter.sh | 44 ---------------------------- .github/workflows/pull_request.yml | 40 ++++++++++++------------- .github/workflows/release.yml | 9 +++--- 3 files changed, 22 insertions(+), 71 deletions(-) delete mode 100644 .github/scripts/setup-tree-sitter.sh diff --git a/.github/scripts/setup-tree-sitter.sh b/.github/scripts/setup-tree-sitter.sh deleted file mode 100644 index aa7b9540f..000000000 --- a/.github/scripts/setup-tree-sitter.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -add_github_path() { - local dir="$1" - - if [[ -n "${GITHUB_PATH:-}" ]]; then - if [[ "${RUNNER_OS:-}" == "Windows" ]] && command -v cygpath >/dev/null 2>&1; then - cygpath -w "${dir}" >>"${GITHUB_PATH}" - else - echo "${dir}" >>"${GITHUB_PATH}" - fi - fi -} - -cargo_bin_dir() { - local cargo_home="${CARGO_HOME:-$HOME/.cargo}" - local dir="${cargo_home}/bin" - - if [[ "${RUNNER_OS:-}" == "Windows" ]] && command -v cygpath >/dev/null 2>&1; then - cygpath -u "${dir}" - else - echo "${dir}" - fi -} - -persist_tree_sitter_path() { - local tree_sitter_path tree_sitter_dir - tree_sitter_path="$(command -v tree-sitter)" - tree_sitter_dir="$(dirname "${tree_sitter_path}")" - - add_github_path "${tree_sitter_dir}" - "${tree_sitter_path}" --version -} - -cargo_bin="$(cargo_bin_dir)" -export PATH="${cargo_bin}:${PATH}" -add_github_path "${cargo_bin}" - -if ! command -v tree-sitter >/dev/null 2>&1; then - cargo install tree-sitter-cli --version "$(cat .tree-sitter-cli-version)" --locked -fi - -persist_tree_sitter_path diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d0ee59399..ecd00597d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -129,16 +129,15 @@ jobs: - uses: actions/cache@v5 with: path: | - ~/.cargo/bin/tree-sitter - ~/.cargo/bin/tree-sitter.exe ~/.cargo/bin/sqlx ~/.cargo/bin/cargo-sqlx target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-cargo-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-tree-sitter-generated-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: Setup tree-sitter - run: bash ./.github/scripts/setup-tree-sitter.sh - shell: bash + uses: tree-sitter/setup-action/cli@v2 + with: + tree-sitter-ref: v0.25.9 - name: Setup sqlx-cli run: command -v sqlx ||cargo install sqlx-cli @@ -202,14 +201,13 @@ jobs: - uses: actions/cache@v5 with: path: | - ~/.cargo/bin/tree-sitter - ~/.cargo/bin/tree-sitter.exe target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-cargo-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-tree-sitter-generated-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: Setup tree-sitter - run: bash ./.github/scripts/setup-tree-sitter.sh - shell: bash + uses: tree-sitter/setup-action/cli@v2 + with: + tree-sitter-ref: v0.25.9 - name: Run clippy run: cargo clippy --all-targets -- -D warnings @@ -245,13 +243,12 @@ jobs: - uses: actions/cache@v5 with: path: | - ~/.cargo/bin/tree-sitter - ~/.cargo/bin/tree-sitter.exe target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-cargo-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - - name: setup tree-sitter - run: bash ./.github/scripts/setup-tree-sitter.sh - shell: bash + key: ${{ runner.os }}-tree-sitter-generated-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + - name: Setup tree-sitter + uses: tree-sitter/setup-action/cli@v2 + with: + tree-sitter-ref: v0.25.9 - name: Build main binary run: cargo build -p pgls_cli --release - name: Setup Bun @@ -336,13 +333,12 @@ jobs: - uses: actions/cache@v5 with: path: | - ~/.cargo/bin/tree-sitter - ~/.cargo/bin/tree-sitter.exe target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-cargo-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - - name: setup tree-sitter - run: bash ./.github/scripts/setup-tree-sitter.sh - shell: bash + key: ${{ runner.os }}-tree-sitter-generated-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + - name: Setup tree-sitter + uses: tree-sitter/setup-action/cli@v2 + with: + tree-sitter-ref: v0.25.9 - name: Ensure RustFMT on nightly toolchain run: rustup component add rustfmt --toolchain nightly - name: Setup Bun diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f5a9670d4..1a8d3b60a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,14 +121,13 @@ jobs: - uses: actions/cache@v5 with: path: | - ~/.cargo/bin/tree-sitter - ~/.cargo/bin/tree-sitter.exe target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-cargo-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-tree-sitter-generated-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} - name: Setup tree-sitter - run: bash ./.github/scripts/setup-tree-sitter.sh - shell: bash + uses: tree-sitter/setup-action/cli@v2 + with: + tree-sitter-ref: v0.25.9 - name: Setup Postgres uses: ./.github/actions/setup-postgres From d740e894fba6d2eae2e1924a8c1441ea6c15b6b4 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Fri, 22 May 2026 22:14:42 +0200 Subject: [PATCH 09/10] ci: pin sqlx cli install --- .github/workflows/pull_request.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ecd00597d..e8f9122fd 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -140,7 +140,7 @@ jobs: tree-sitter-ref: v0.25.9 - name: Setup sqlx-cli - run: command -v sqlx ||cargo install sqlx-cli + run: command -v sqlx || cargo install sqlx-cli --version 0.8.6 --locked - name: Setup Bun uses: oven-sh/setup-bun@v2 From b6bcfeb348aea7965fe8b32df07eccef209c38c8 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Fri, 22 May 2026 22:25:39 +0200 Subject: [PATCH 10/10] ci: minimize workflow fixes --- .github/actions/setup-postgres/action.yml | 14 ++++++++++++-- .github/workflows/pull_request.yml | 12 ++++++++---- .github/workflows/release.yml | 8 ++++---- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/actions/setup-postgres/action.yml b/.github/actions/setup-postgres/action.yml index ac0c9e1fc..205085a48 100644 --- a/.github/actions/setup-postgres/action.yml +++ b/.github/actions/setup-postgres/action.yml @@ -140,8 +140,8 @@ runs: -e POSTGRES_DB=postgres \ -p 5432:5432 \ postgres-language-server-dev:latest - # The Dockerfile's init script installs the extensions. Wait for init to - # finish so pg_isready doesn't catch the temporary bootstrap server. + # Wait for the image's init scripts to finish before checking readiness; + # pg_isready can briefly catch Docker's temporary bootstrap server. for _ in {1..60}; do if docker logs postgres 2>&1 | grep -Eq "PostgreSQL init process complete|Skipping initialization"; then break @@ -155,3 +155,13 @@ runs: fi sleep 1 done + + # Create extensions in postgres database only (NOT template1) + # This avoids polluting test databases - tests that need extensions can create them explicitly + echo "Creating extensions in postgres database..." + docker exec postgres psql -U postgres -c "CREATE SCHEMA IF NOT EXISTS extensions;" + docker exec postgres psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS plpgsql_check SCHEMA extensions;" + docker exec postgres psql -U postgres -c "CREATE EXTENSION IF NOT EXISTS pglinter SCHEMA extensions;" + + # Show extension status + docker exec postgres psql -U postgres -c "SELECT extname, extversion FROM pg_extension WHERE extname IN ('plpgsql_check', 'pglinter');" diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index e8f9122fd..f7f98e7c9 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -129,10 +129,11 @@ jobs: - uses: actions/cache@v5 with: path: | + ~/.cargo/bin/tree-sitter ~/.cargo/bin/sqlx ~/.cargo/bin/cargo-sqlx target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-generated-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} - name: Setup tree-sitter uses: tree-sitter/setup-action/cli@v2 @@ -201,8 +202,9 @@ jobs: - uses: actions/cache@v5 with: path: | + ~/.cargo/bin/tree-sitter target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-generated-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} - name: Setup tree-sitter uses: tree-sitter/setup-action/cli@v2 @@ -243,8 +245,9 @@ jobs: - uses: actions/cache@v5 with: path: | + ~/.cargo/bin/tree-sitter target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-generated-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} - name: Setup tree-sitter uses: tree-sitter/setup-action/cli@v2 with: @@ -333,8 +336,9 @@ jobs: - uses: actions/cache@v5 with: path: | + ~/.cargo/bin/tree-sitter target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-generated-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} - name: Setup tree-sitter uses: tree-sitter/setup-action/cli@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a8d3b60a..2d714f58e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -121,13 +121,13 @@ jobs: - uses: actions/cache@v5 with: path: | + ~/.cargo/bin/tree-sitter target/**/build/pgls_treesitter_grammar-*/out/generated - key: ${{ runner.os }}-tree-sitter-generated-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml') }} + key: ${{ runner.os }}-tree-sitter-${{ hashFiles('.tree-sitter-cli-version', 'crates/pgls_treesitter_grammar/grammar.js', 'crates/pgls_treesitter_grammar/tree-sitter.json', 'rust-toolchain.toml', 'Cargo.lock') }} - name: Setup tree-sitter - uses: tree-sitter/setup-action/cli@v2 - with: - tree-sitter-ref: v0.25.9 + run: command -v tree-sitter || cargo install tree-sitter-cli --version "$(cat .tree-sitter-cli-version)" --locked + shell: bash - name: Setup Postgres uses: ./.github/actions/setup-postgres