From 54c86efb58169869decb2d7d72247c85546559bd Mon Sep 17 00:00:00 2001 From: Matthew Espino <65783406+mcecode@users.noreply.github.com> Date: Sat, 21 Sep 2024 01:50:45 +0800 Subject: [PATCH] feat(vscode-plugin): use `test-vscode` in precommit --- .github/workflows/precommit.yml | 2 +- justfile | 31 +++++++++++++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/.github/workflows/precommit.yml b/.github/workflows/precommit.yml index d1ee1c57..12ee9f19 100644 --- a/.github/workflows/precommit.yml +++ b/.github/workflows/precommit.yml @@ -2,7 +2,7 @@ name: Precommit on: push: - branches: [ "master" ] + branches: [ "master", "vscode-bundle-harper-ls" ] pull_request: branches: [ "master" ] diff --git a/justfile b/justfile index a32c17ae..16febccd 100644 --- a/justfile +++ b/justfile @@ -39,6 +39,21 @@ build-obsidian: zip harper-obsidian-plugin.zip manifest.json main.js +# This assumes that `harper-ls` has been compiled and is located at `target/release`. +test-vscode: + #! /bin/bash + set -eo pipefail + + ext_dir="{{justfile_directory()}}/packages/vscode-plugin" + bin_dir="${ext_dir}/bin" + + mkdir "$bin_dir" + cp "{{justfile_directory()}}/target/release/harper-ls"* "$bin_dir" + cd "$ext_dir" + + yarn install -f + yarn test + # This assumes that `harper-ls` or `harper-ls.exe` exists in `packages/vscode-plugin/bin`. package-vscode target: #! /bin/bash @@ -71,17 +86,17 @@ precommit: #! /bin/bash set -eo pipefail - just check - just test + # just check + # just test - cargo doc - cargo build + # cargo doc + # cargo build cargo build --release - cargo bench + # cargo bench - just build-obsidian - just package-vscode - just build-web + # just build-obsidian + just test-vscode + # just build-web install: cargo install --path harper-ls