Skip to content

Commit 751a252

Browse files
committed
ci(ci): use powershell for windows test step to fix environment access
- Split Test step into Unix and Windows variants - Use PowerShell on Windows for proper COMSPEC and env variable access - Keep bash for Unix platforms (ubuntu, macos)
1 parent 90d8ad8 commit 751a252

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,19 @@ jobs:
5656
- name: Type check
5757
run: deno check src/index.ts
5858

59-
- name: Test
59+
- name: Test (Unix)
60+
if: runner.os != 'Windows'
6061
shell: bash
6162
run: |
62-
if [ "${{ runner.os }}" = "Windows" ]; then
63-
export PATH="${{ steps.node_path.outputs.node_dir_bash }}:$PATH"
64-
fi
6563
echo "PATH: $PATH"
6664
which node || echo "node not in PATH"
6765
deno test --allow-read --allow-env --allow-run
66+
67+
- name: Test (Windows)
68+
if: runner.os == 'Windows'
69+
shell: pwsh
70+
run: |
71+
$env:PATH = "${{ steps.node_path.outputs.node_dir }};$env:PATH"
72+
echo "PATH: $env:PATH"
73+
Get-Command node -ErrorAction SilentlyContinue | ForEach-Object { $_.Source } | Write-Host
74+
deno test --allow-read --allow-env --allow-run

0 commit comments

Comments
 (0)