diff --git a/.github/workflows/extension_tests.yml b/.github/workflows/extension_tests.yml index ef0e28715ce038c6ca9e38d4126b20e2276ce3c2..5160aba2869b1a3234c686a6508460784b0536b1 100644 --- a/.github/workflows/extension_tests.yml +++ b/.github/workflows/extension_tests.yml @@ -109,6 +109,21 @@ jobs: mkdir -p /tmp/ext-scratch mkdir -p /tmp/ext-output ./zed-extension --source-dir . --scratch-dir /tmp/ext-scratch --output-dir /tmp/ext-output + - name: run_tests::fetch_ts_query_ls + uses: dsaltares/fetch-gh-release-asset@aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c + with: + repo: ribru17/ts_query_ls + version: tags/v3.15.1 + file: ts_query_ls-x86_64-unknown-linux-gnu.tar.gz + - name: run_tests::run_ts_query_ls + run: |- + tar -xf ts_query_ls-x86_64-unknown-linux-gnu.tar.gz + ./ts_query_ls format --check . || { + echo "Found unformatted queries, please format them with ts_query_ls." + echo "For easy use, install the Tree-sitter query extension:" + echo "zed://extension/tree-sitter-query" + false + } - id: compare-versions-check name: extension_bump::compare_versions run: | diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index 96c763045cb75906e613744fcfb13764f617a278..29f888cbb596593052c6adebe2341171eac9055d 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -139,13 +139,13 @@ jobs: uses: crate-ci/typos@2d0ce569feab1f8752f1dde43cc2f2aa53236e06 with: config: ./typos.toml - - name: run_tests::check_style::fetch_ts_query_ls + - name: run_tests::fetch_ts_query_ls uses: dsaltares/fetch-gh-release-asset@aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c with: repo: ribru17/ts_query_ls version: tags/v3.15.1 file: ts_query_ls-x86_64-unknown-linux-gnu.tar.gz - - name: run_tests::check_style::run_ts_query_ls + - name: run_tests::run_ts_query_ls run: |- tar -xf ts_query_ls-x86_64-unknown-linux-gnu.tar.gz ./ts_query_ls format --check . || { diff --git a/tooling/xtask/src/tasks/workflows/extension_tests.rs b/tooling/xtask/src/tasks/workflows/extension_tests.rs index a650013bacfcfc1ac89a60ccfe8674a5621fb1c7..de4f1dd94267a55dcc3e1555c1a5673ff813ad26 100644 --- a/tooling/xtask/src/tasks/workflows/extension_tests.rs +++ b/tooling/xtask/src/tasks/workflows/extension_tests.rs @@ -3,7 +3,9 @@ use indoc::{formatdoc, indoc}; use crate::tasks::workflows::{ extension_bump::compare_versions, - run_tests::{orchestrate_without_package_filter, tests_pass}, + run_tests::{ + fetch_ts_query_ls, orchestrate_without_package_filter, run_ts_query_ls, tests_pass, + }, runners, steps::{ self, CommonJobConditions, FluentBuilder, NamedJob, cache_rust_dependencies_namespace, @@ -94,6 +96,8 @@ pub(crate) fn check_extension() -> NamedJob { .add_step(download_zed_extension_cli(cache_hit)) .add_step(cache_rust_dependencies_namespace()) // Extensions can compile Rust, so provide the cache if needed. .add_step(check()) + .add_step(fetch_ts_query_ls()) + .add_step(run_ts_query_ls()) .add_step(check_version_job) .add_step(verify_version_did_not_change(version_changed)); diff --git a/tooling/xtask/src/tasks/workflows/run_tests.rs b/tooling/xtask/src/tasks/workflows/run_tests.rs index 4130e53f724847b3f1bef5bf083f782cc7e9e0dc..d617dda5af0ad51d0e86cfeeb69a035a53c07663 100644 --- a/tooling/xtask/src/tasks/workflows/run_tests.rs +++ b/tooling/xtask/src/tasks/workflows/run_tests.rs @@ -271,6 +271,29 @@ pub fn tests_pass(jobs: &[NamedJob]) -> NamedJob { const TS_QUERY_LS_FILE: &str = "ts_query_ls-x86_64-unknown-linux-gnu.tar.gz"; const CI_TS_QUERY_RELEASE: &str = "tags/v3.15.1"; +pub(crate) fn fetch_ts_query_ls() -> Step { + named::uses( + "dsaltares", + "fetch-gh-release-asset", + "aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c", + ) // v1.1.1 + .add_with(("repo", "ribru17/ts_query_ls")) + .add_with(("version", CI_TS_QUERY_RELEASE)) + .add_with(("file", TS_QUERY_LS_FILE)) +} + +pub(crate) fn run_ts_query_ls() -> Step { + named::bash(formatdoc!( + r#"tar -xf {TS_QUERY_LS_FILE} + ./ts_query_ls format --check . || {{ + echo "Found unformatted queries, please format them with ts_query_ls." + echo "For easy use, install the Tree-sitter query extension:" + echo "zed://extension/tree-sitter-query" + false + }}"# + )) +} + fn check_style() -> NamedJob { fn check_for_typos() -> Step { named::uses( @@ -281,29 +304,6 @@ fn check_style() -> NamedJob { .with(("config", "./typos.toml")) } - fn fetch_ts_query_ls() -> Step { - named::uses( - "dsaltares", - "fetch-gh-release-asset", - "aa37ae5c44d3c9820bc12fe675e8670ecd93bd1c", - ) // v1.1.1 - .add_with(("repo", "ribru17/ts_query_ls")) - .add_with(("version", CI_TS_QUERY_RELEASE)) - .add_with(("file", TS_QUERY_LS_FILE)) - } - - fn run_ts_query_ls() -> Step { - named::bash(formatdoc!( - r#"tar -xf {TS_QUERY_LS_FILE} - ./ts_query_ls format --check . || {{ - echo "Found unformatted queries, please format them with ts_query_ls." - echo "For easy use, install the Tree-sitter query extension:" - echo "zed://extension/tree-sitter-query" - false - }}"# - )) - } - named::job( release_job(&[]) .runs_on(runners::LINUX_MEDIUM)