From ebb7e76c08ca107905f29c4bec856027c996eb29 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Mon, 7 Apr 2025 15:33:39 -0400 Subject: [PATCH 1/6] Run CLI wrapper tests on all three platforms --- .github/workflows/tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 60f872d9f..6bbeb34ce 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -113,7 +113,10 @@ jobs: test-cli-wrapper: name: "Test CLI Wrapper" - runs-on: ubuntu-latest + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} env: DEBUG: "*" steps: From d1b17a167708c19352470e7b8eaaf70c29832076 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Mon, 7 Apr 2025 15:47:27 -0400 Subject: [PATCH 2/6] Use bash for tests, even on Windows --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6bbeb34ce..16a682af4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -139,6 +139,7 @@ jobs: yarn workspace gel pack --filename=${{ github.workspace }}/edgedb-cli.tar.gz - name: Test CLI wrapper with npm + shell: bash run: | mkdir ${{ runner.temp }}/temp-npm cd ${{ runner.temp }}/temp-npm @@ -155,6 +156,7 @@ jobs: fi - name: Test CLI wrapper with yarn + shell: bash run: | mkdir ${{ runner.temp }}/temp-yarn cd ${{ runner.temp }}/temp-yarn @@ -175,6 +177,7 @@ jobs: version: latest cache: false - name: Test CLI wrapper with yarn-berry + shell: bash run: | mkdir ${{ runner.temp }}/temp-yarn-berry cd ${{ runner.temp }}/temp-yarn-berry @@ -197,6 +200,7 @@ jobs: version: latest run_install: false - name: Test CLI wrapper with pnpm + shell: bash run: | mkdir ${{ runner.temp }}/temp-pnpm cd ${{ runner.temp}}/temp-pnpm @@ -214,6 +218,7 @@ jobs: - uses: oven-sh/setup-bun@8f24390df009a496891208e5e36b8a1de1f45135 - name: Test CLI wrapper with bun + shell: bash run: | mkdir temp-bun cd temp-bun From 9dbba984c9a1fe2e4e9c564c408a2fdefee10fb4 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Mon, 7 Apr 2025 16:24:42 -0400 Subject: [PATCH 3/6] Quote expansion to avoid Windows path issues --- .github/workflows/tests.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 16a682af4..64ed1d152 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -141,10 +141,10 @@ jobs: - name: Test CLI wrapper with npm shell: bash run: | - mkdir ${{ runner.temp }}/temp-npm - cd ${{ runner.temp }}/temp-npm + mkdir "${{ runner.temp }}/temp-npm" + cd "${{ runner.temp }}/temp-npm" npm init -y - npm install ${{ github.workspace }}/edgedb-cli.tar.gz + npm install "${{ github.workspace }}/edgedb-cli.tar.gz" npm exec gel -- project init --non-interactive npm exec gel -- --version npm exec gel -- query 'select sys::get_version_as_str()' @@ -158,10 +158,10 @@ jobs: - name: Test CLI wrapper with yarn shell: bash run: | - mkdir ${{ runner.temp }}/temp-yarn - cd ${{ runner.temp }}/temp-yarn + mkdir "${{ runner.temp }}/temp-yarn" + cd "${{ runner.temp }}/temp-yarn" yarn init -y - yarn add ${{ github.workspace}}/edgedb-cli.tar.gz + yarn add "${{ github.workspace}}/edgedb-cli.tar.gz" yarn gel project init --non-interactive yarn gel --version yarn gel query 'select sys::get_version_as_str()' @@ -179,12 +179,12 @@ jobs: - name: Test CLI wrapper with yarn-berry shell: bash run: | - mkdir ${{ runner.temp }}/temp-yarn-berry - cd ${{ runner.temp }}/temp-yarn-berry + mkdir "${{ runner.temp }}/temp-yarn-berry" + cd "${{ runner.temp }}/temp-yarn-berry" yarn set version berry yarn init -y touch yarn.lock - yarn add ${{ github.workspace }}/edgedb-cli.tar.gz + yarn add "${{ github.workspace }}/edgedb-cli.tar.gz" yarn gel project init --non-interactive yarn gel --version yarn gel query 'select sys::get_version_as_str()' @@ -202,10 +202,10 @@ jobs: - name: Test CLI wrapper with pnpm shell: bash run: | - mkdir ${{ runner.temp }}/temp-pnpm - cd ${{ runner.temp}}/temp-pnpm + mkdir "${{ runner.temp }}/temp-pnpm" + cd "${{ runner.temp}}/temp-pnpm" pnpm init - pnpm add ${{ github.workspace }}/edgedb-cli.tar.gz + pnpm add "${{ github.workspace }}/edgedb-cli.tar.gz" pnpm exec gel project init --non-interactive pnpm exec gel --version pnpm exec gel query 'select sys::get_version_as_str()' @@ -220,10 +220,10 @@ jobs: - name: Test CLI wrapper with bun shell: bash run: | - mkdir temp-bun - cd temp-bun + mkdir "${{ runner.temp }}/temp-bun" + cd "${{ runner.temp }}/temp-bun" bun init - bun add ${{ github.workspace }}/edgedb-cli.tar.gz + bun add "${{ github.workspace }}/edgedb-cli.tar.gz" bun gel project init --non-interactive bun gel --version bun gel query 'select sys::get_version_as_str()' From cf5d2300e7babdffb54edd8cb1fe6e327e3d53b4 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Tue, 8 Apr 2025 10:27:02 -0400 Subject: [PATCH 4/6] Use windows-style path for gel binary --- packages/gel/src/cli.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/gel/src/cli.mts b/packages/gel/src/cli.mts index ba46db2a5..cd62f072e 100644 --- a/packages/gel/src/cli.mts +++ b/packages/gel/src/cli.mts @@ -17,7 +17,7 @@ const IS_TTY = process.stdout.isTTY; const SCRIPT_LOCATION = await fs.realpath(fileURLToPath(import.meta.url)); const EDGEDB_PKG_ROOT = "https://packages.edgedb.com"; const CACHE_DIR = envPaths("gel", { suffix: "" }).cache; -const CACHED_CLI_PATH = path.join(CACHE_DIR, "/bin/gel"); +const CACHED_CLI_PATH = path.join(CACHE_DIR, "bin", process.platform === "win32" ? "gel.exe" : "gel"); const SCRIPT_NAME = import.meta.url.split("/").pop() || "gel"; From c37dcf3c891ed34db8d2d889ed2ad0a911d473a3 Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Tue, 8 Apr 2025 11:03:45 -0400 Subject: [PATCH 5/6] Format --- packages/gel/src/cli.mts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/gel/src/cli.mts b/packages/gel/src/cli.mts index cd62f072e..9e6c4b871 100644 --- a/packages/gel/src/cli.mts +++ b/packages/gel/src/cli.mts @@ -17,7 +17,11 @@ const IS_TTY = process.stdout.isTTY; const SCRIPT_LOCATION = await fs.realpath(fileURLToPath(import.meta.url)); const EDGEDB_PKG_ROOT = "https://packages.edgedb.com"; const CACHE_DIR = envPaths("gel", { suffix: "" }).cache; -const CACHED_CLI_PATH = path.join(CACHE_DIR, "bin", process.platform === "win32" ? "gel.exe" : "gel"); +const CACHED_CLI_PATH = path.join( + CACHE_DIR, + "bin", + process.platform === "win32" ? "gel.exe" : "gel", +); const SCRIPT_NAME = import.meta.url.split("/").pop() || "gel"; From ad324e0db285605f7613a18e4084a56bdfe39fca Mon Sep 17 00:00:00 2001 From: Scott Trinh Date: Tue, 8 Apr 2025 11:03:51 -0400 Subject: [PATCH 6/6] Update kernel for wsl2 --- .github/workflows/tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 64ed1d152..862eb7abc 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -138,6 +138,11 @@ jobs: yarn workspace gel run build yarn workspace gel pack --filename=${{ github.workspace }}/edgedb-cli.tar.gz + - name: Update Linux kernel for WSL2 (Windows only) + if: runner.os == 'Windows' + run: | + wsl --update + - name: Test CLI wrapper with npm shell: bash run: |