ci: add orchestrator compatibility validation workflow

Runs on PRs that touch orchestrator source or bridge files.
Validates:
- Orchestrator source files are in sync with standalone repo
- Bridge file exports exist in both repos
- Orchestrator tests pass in both unity-builder and standalone contexts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
frostebite
2026-03-10 00:56:12 +00:00
parent 25dbf37f6b
commit 20b01e1325
3 changed files with 263 additions and 63 deletions

View File

@@ -0,0 +1,95 @@
name: Validate Orchestrator Compatibility
on:
push:
branches: [main, 'release/**', 'feature/**']
paths:
- 'src/model/orchestrator/**'
- 'src/model/build-parameters.ts'
- 'src/model/input.ts'
- 'src/model/github.ts'
- 'src/model/docker.ts'
- 'src/model/cli/cli.ts'
- 'src/model/cli/cli-functions-repository.ts'
- 'src/model/input-readers/**'
- 'src/model/shared-types.ts'
- 'src/model/image-tag.ts'
- 'src/model/action.ts'
pull_request:
branches: [main, 'release/**']
paths:
- 'src/model/orchestrator/**'
- 'src/model/build-parameters.ts'
- 'src/model/input.ts'
- 'src/model/github.ts'
- 'src/model/docker.ts'
- 'src/model/cli/cli.ts'
- 'src/model/cli/cli-functions-repository.ts'
- 'src/model/input-readers/**'
- 'src/model/shared-types.ts'
- 'src/model/image-tag.ts'
- 'src/model/action.ts'
jobs:
validate-orchestrator:
name: Orchestrator Compatibility Check
runs-on: ubuntu-latest
steps:
- name: Checkout unity-builder
uses: actions/checkout@v4
- name: Checkout orchestrator repo
uses: actions/checkout@v4
with:
repository: game-ci/orchestrator
path: orchestrator-standalone
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
- name: Install unity-builder dependencies
run: yarn install --frozen-lockfile
- name: Verify orchestrator source is in sync
run: |
echo "Comparing orchestrator source files..."
# Compare orchestrator source between unity-builder and standalone repo
# Exclude interfaces.ts which only exists in standalone
DIFF_OUTPUT=$(diff -rq src/model/orchestrator/ orchestrator-standalone/src/model/orchestrator/ --exclude="interfaces.ts" 2>&1 || true)
if [ -n "$DIFF_OUTPUT" ]; then
echo "::warning::Orchestrator source has diverged from standalone repo:"
echo "$DIFF_OUTPUT"
echo ""
echo "Files that differ:"
diff -rq src/model/orchestrator/ orchestrator-standalone/src/model/orchestrator/ --exclude="interfaces.ts" | head -20 || true
else
echo "✓ All orchestrator source files are in sync"
fi
- name: Verify bridge file compatibility
run: |
echo "Checking that bridge file exports match unity-builder exports..."
# Verify key exports exist in both repos
for file in build-parameters input github docker action image-tag; do
if [ -f "orchestrator-standalone/src/model/${file}.ts" ]; then
echo "✓ Bridge file exists: src/model/${file}.ts"
else
echo "::error::Missing bridge file in orchestrator: src/model/${file}.ts"
exit 1
fi
done
- name: Run orchestrator tests in unity-builder context
run: |
echo "Running orchestrator unit tests..."
npx jest --no-cache --testPathPattern="src/model/orchestrator/" --passWithNoTests 2>&1 | tail -5
- name: Run orchestrator tests in standalone context
working-directory: orchestrator-standalone
run: |
yarn install --frozen-lockfile
echo "Running orchestrator standalone tests..."
npx jest --no-cache 2>&1 | tail -5