Skip to content

Format PROVENANCE.md #77

Format PROVENANCE.md

Format PROVENANCE.md #77

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Format, lint, typecheck, test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Format check
run: pnpm format:check
- name: Lint
run: pnpm lint
- name: Typecheck
run: pnpm typecheck
# A protocol change updates client, server and tests in one commit
# (PRD §17.2), so a single test run covers cross-side compatibility.
- name: Test
run: pnpm test
# PowerShell runs on Linux, so the Windows installer is checkable here
# rather than trusted on inspection.
- name: Install PowerShell
env:
# Authenticated so the release lookup is not subject to the shared
# runners' unauthenticated GitHub API rate limit. Hitting that limit
# returned an empty URL, `curl -fsSL ""` failed, and the whole job
# went red for a reason that had nothing to do with the code.
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Known-good fallback if the API is unavailable entirely.
PWSH_FALLBACK: "7.4.6"
run: |
set -euo pipefail
resolve_url() {
curl -fsSL -H "Authorization: Bearer $GH_TOKEN" \
https://api.github.com/repos/PowerShell/PowerShell/releases/latest \
| grep -o '"browser_download_url": *"[^"]*linux-x64.tar.gz"' \
| cut -d'"' -f4 | head -1
}
URL=""
for attempt in 1 2 3; do
URL=$(resolve_url || true)
[ -n "$URL" ] && break
echo "release lookup attempt $attempt failed, retrying" >&2
sleep $((attempt * 5))
done
if [ -z "$URL" ]; then
echo "falling back to pinned PowerShell $PWSH_FALLBACK" >&2
URL="https://github.com/PowerShell/PowerShell/releases/download/v${PWSH_FALLBACK}/powershell-${PWSH_FALLBACK}-linux-x64.tar.gz"
fi
mkdir -p "$HOME/.pwsh"
curl -fsSL --retry 3 --retry-delay 5 "$URL" | tar -xz -C "$HOME/.pwsh"
chmod +x "$HOME/.pwsh/pwsh"
echo "$HOME/.pwsh" >> "$GITHUB_PATH"
- name: Check installers
run: |
sudo apt-get update -qq && sudo apt-get install -y devscripts >/dev/null 2>&1 || true
sh tools/release/check-installers.sh
build:
name: Build all workspaces
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm build
loadtest:
name: Multiplayer simulation load gate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v5
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
# Smaller than the release gate, but enough to catch a tick-budget or
# memory-growth regression on every pull request (PRD §34.3).
- name: Simulation load and soak
run: pnpm loadtest -- --rooms 8 --matches 8 --ticks 2500