The hash included `ts` in the input despite the docstring promising it was "independent of ts/actor/session". On Windows, millisecond timer resolution caused two calls within the same tick to get different timestamps, producing different hashes for identical cmd+params. Remove `ts` from the hash input to match documented behavior. Revert continue-on-error on windows-portability now that the root cause is fixed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
172 lines
4.5 KiB
YAML
172 lines
4.5 KiB
YAML
# CI workflow — builds, tests, and gates merges to main
|
|
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths-ignore:
|
|
- '.github/workflows/ai-triage.yml'
|
|
- '.github/workflows/build-native.yml'
|
|
- '.github/workflows/cleanup-dev-versions.yml'
|
|
- '.github/workflows/pipeline.yml'
|
|
- 'LICENSE'
|
|
pull_request:
|
|
branches: [main]
|
|
paths-ignore:
|
|
- '.github/workflows/ai-triage.yml'
|
|
- '.github/workflows/build-native.yml'
|
|
- '.github/workflows/cleanup-dev-versions.yml'
|
|
- '.github/workflows/pipeline.yml'
|
|
- 'LICENSE'
|
|
|
|
concurrency:
|
|
group: ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
detect-changes:
|
|
timeout-minutes: 2
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
outputs:
|
|
docs-only: ${{ steps.check.outputs.docs-only }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Check if only documentation changed
|
|
id: check
|
|
env:
|
|
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
|
PUSH_BEFORE_SHA: ${{ github.event.before }}
|
|
EVENT_NAME: ${{ github.event_name }}
|
|
HEAD_SHA: ${{ github.sha }}
|
|
run: |
|
|
if [ "$EVENT_NAME" = "pull_request" ]; then
|
|
BASE="$PR_BASE_SHA"
|
|
else
|
|
BASE="$PUSH_BEFORE_SHA"
|
|
fi
|
|
FILES=$(git diff --name-only "$BASE" "$HEAD_SHA" 2>/dev/null || git diff --name-only HEAD~1)
|
|
echo "Changed files:"
|
|
echo "$FILES"
|
|
NON_DOCS=$(echo "$FILES" | grep -vE '\.(md|markdown)$' | grep -vE '^docs/' | grep -vE '^LICENSE$' || true)
|
|
if [ -z "$NON_DOCS" ]; then
|
|
echo "docs-only=true" >> "$GITHUB_OUTPUT"
|
|
echo "::notice::Only documentation files changed — skipping build/test"
|
|
else
|
|
echo "docs-only=false" >> "$GITHUB_OUTPUT"
|
|
echo "Non-docs files changed:"
|
|
echo "$NON_DOCS"
|
|
fi
|
|
|
|
docs-check:
|
|
timeout-minutes: 5
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
needs: detect-changes
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Scan documentation for prompt injection
|
|
run: bash scripts/docs-prompt-injection-scan.sh --diff origin/main
|
|
|
|
lint:
|
|
timeout-minutes: 5
|
|
needs: detect-changes
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 2
|
|
|
|
- name: Scan for hardcoded secrets
|
|
run: bash scripts/secret-scan.sh --diff origin/main
|
|
|
|
- name: Scan for base64-encoded secrets
|
|
run: bash scripts/base64-scan.sh --diff origin/main
|
|
|
|
- name: Ensure .gsd/ is not checked in
|
|
run: |
|
|
if [ -d ".gsd" ]; then
|
|
echo "::error::.gsd/ directory must not be checked in"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '24'
|
|
|
|
- name: Validate skill references
|
|
run: node scripts/check-skill-references.mjs
|
|
|
|
build:
|
|
timeout-minutes: 15
|
|
needs: detect-changes
|
|
if: needs.detect-changes.outputs.docs-only != 'true'
|
|
runs-on: blacksmith-4vcpu-ubuntu-2404
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '24'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Install web host dependencies
|
|
run: npm --prefix web ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Build web host
|
|
run: npm run build:web-host
|
|
|
|
- name: Typecheck extensions
|
|
run: npm run typecheck:extensions
|
|
|
|
- name: Validate package is installable
|
|
run: npm run validate-pack
|
|
|
|
- name: Run unit tests
|
|
run: npm run test:unit
|
|
|
|
- name: Run integration tests
|
|
run: npm run test:integration
|
|
|
|
windows-portability:
|
|
timeout-minutes: 15
|
|
needs: detect-changes
|
|
if: >-
|
|
needs.detect-changes.outputs.docs-only != 'true'
|
|
runs-on: blacksmith-4vcpu-windows-2025
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: '24'
|
|
cache: 'npm'
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build
|
|
run: npm run build
|
|
|
|
- name: Typecheck extensions
|
|
run: npm run typecheck:extensions
|
|
|
|
- name: Run unit tests
|
|
run: npm run test:unit
|