From 27ab8fb543a63d936e313dd81de2e507568cbcf1 Mon Sep 17 00:00:00 2001 From: Libby Date: Mon, 9 Nov 2026 15:26:28 +0000 Subject: [PATCH] CI: back to ubuntu-latest, install PowerShell where a Linux job needs pwsh The forge has two labels: docker (node 22, py 3.11) and ubuntu-latest (act-latest, node 24, py 3.12); neither carries pwsh. Windows legs stay workflow_dispatch only. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/portable-contracts.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/portable-contracts.yml b/.github/workflows/portable-contracts.yml index b71d7b0..93b1a74 100644 --- a/.github/workflows/portable-contracts.yml +++ b/.github/workflows/portable-contracts.yml @@ -17,9 +17,9 @@ jobs: fail-fast: false matrix: # No Windows runner exists: the windows-latest leg runs on workflow_dispatch only (GitHub or a - # Windows runner), the docker leg gates push and PR. Windows push/PR triggers return in the PR + # Windows runner), the ubuntu-latest leg gates push and PR. Windows push/PR triggers return in the PR # that registers a Windows runner. - os: ${{ fromJSON(github.event_name == 'workflow_dispatch' && '["windows-latest", "docker"]' || '["docker"]') }} + os: ${{ fromJSON(github.event_name == 'workflow_dispatch' && '["windows-latest", "ubuntu-latest"]' || '["ubuntu-latest"]') }} package: [eve-contracts, eve-browser-lowering] steps: @@ -41,6 +41,23 @@ jobs: working-directory: packages/${{ matrix.package }} run: npm test + # The forge runner images carry no pwsh; GitHub's Windows and hosted images do. + - name: Install PowerShell + if: runner.os == 'Linux' + shell: bash + run: | + set -euo pipefail + if command -v pwsh >/dev/null; then pwsh -Version; exit 0; fi + SUDO=""; [ "$(id -u)" -eq 0 ] || SUDO="sudo" + PWSH_VERSION=7.4.6 + curl -fsSL "https://github.com/PowerShell/PowerShell/releases/download/v${PWSH_VERSION}/powershell-${PWSH_VERSION}-linux-x64.tar.gz" -o "${RUNNER_TEMP:-/tmp}/powershell.tar.gz" + $SUDO mkdir -p /opt/microsoft/powershell/7 + $SUDO tar -xzf "${RUNNER_TEMP:-/tmp}/powershell.tar.gz" -C /opt/microsoft/powershell/7 + $SUDO chmod +x /opt/microsoft/powershell/7/pwsh + $SUDO ln -sf /opt/microsoft/powershell/7/pwsh /usr/local/bin/pwsh + echo "DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1" >> "$GITHUB_ENV" + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 pwsh -Version + - name: Reject stale generated output shell: pwsh run: |