ci: run Windows job in pwsh (#569) (thanks @bjesuiter)

This commit is contained in:
Peter Steinberger 2026-01-09 14:57:23 +01:00
parent bdb2a660d7
commit d148c71368

View File

@ -94,7 +94,7 @@ jobs:
runs-on: windows-2022 runs-on: windows-2022
defaults: defaults:
run: run:
shell: bash shell: pwsh
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
@ -119,20 +119,20 @@ jobs:
- name: Force UTF-8 output (Windows) - name: Force UTF-8 output (Windows)
run: | run: |
echo "LANG=en_US.UTF-8" >> "$GITHUB_ENV" chcp.com 65001
echo "LC_ALL=en_US.UTF-8" >> "$GITHUB_ENV" [Console]::OutputEncoding = [System.Text.Encoding]::UTF8
"LANG=en_US.UTF-8" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
"LC_ALL=en_US.UTF-8" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Checkout submodules (retry) - name: Checkout submodules (retry)
run: | run: |
set -euo pipefail
git submodule sync --recursive git submodule sync --recursive
for attempt in 1 2 3 4 5; do for ($attempt = 1; $attempt -le 5; $attempt++) {
if git -c protocol.version=2 submodule update --init --force --depth=1 --recursive; then git -c protocol.version=2 submodule update --init --force --depth=1 --recursive
exit 0 if ($LASTEXITCODE -eq 0) { exit 0 }
fi Write-Host "Submodule update failed (attempt $attempt/5). Retrying..."
echo "Submodule update failed (attempt $attempt/5). Retrying…" Start-Sleep -Seconds ($attempt * 10)
sleep $((attempt * 10)) }
done
exit 1 exit 1
- name: Setup Node.js - name: Setup Node.js
@ -148,19 +148,17 @@ jobs:
- name: Runtime versions - name: Runtime versions
run: | run: |
chcp.com 65001
node -v node -v
npm -v npm -v
bun -v bun -v
- name: Capture node path - name: Capture node path
run: | run: |
chcp.com 65001 $nodeBin = Split-Path -Parent (node -p "process.execPath")
echo "NODE_BIN=$(dirname \"$(node -p \"process.execPath\")\")" >> "$GITHUB_ENV" "NODE_BIN=$nodeBin" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Enable corepack and pin pnpm - name: Enable corepack and pin pnpm
run: | run: |
chcp.com 65001
corepack enable corepack enable
corepack prepare pnpm@10.23.0 --activate corepack prepare pnpm@10.23.0 --activate
pnpm -v pnpm -v
@ -169,16 +167,14 @@ jobs:
env: env:
CI: true CI: true
run: | run: |
chcp.com 65001 $env:PATH = "$env:NODE_BIN;$env:PATH"
export PATH="$NODE_BIN:$PATH" Get-Command node | Format-List
which node
node -v node -v
pnpm -v pnpm -v
pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true || pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true || pnpm install --ignore-scripts=false --config.engine-strict=false --config.enable-pre-post-scripts=true
- name: Run ${{ matrix.task }} (${{ matrix.runtime }}) - name: Run ${{ matrix.task }} (${{ matrix.runtime }})
run: | run: |
chcp.com 65001
${{ matrix.command }} ${{ matrix.command }}
macos-app: macos-app: