mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-06-01 06:16:14 -07:00
- Delete src/cli.ts, src/cli/ (commands, tests, input-mapper) — moved to game-ci/orchestrator repo (PR #813 reference) - Delete .github/workflows/release-cli.yml — moved to orchestrator - Remove bin, pkg, yargs, @types/yargs, pkg from package.json - Fix validate-orchestrator.yml: - Build TypeScript before running require() smoke tests - Remove || echo fallback that swallowed errors - Add smoke test that installs orchestrator via npm pack and verifies loadOrchestrator() returns defined exports Legacy src/model/cli/ (Cli class, CliFunctionsRepository) preserved — used by Input.getInput() and build-parameters.ts on main. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
139 lines
5.1 KiB
YAML
139 lines
5.1 KiB
YAML
name: Validate Orchestrator Compatibility
|
|
|
|
on:
|
|
push:
|
|
branches: [main, 'release/**', 'feature/**']
|
|
paths:
|
|
- 'src/model/orchestrator-plugin.ts'
|
|
- 'src/model/build-parameters.ts'
|
|
- 'src/model/input.ts'
|
|
- 'src/model/github.ts'
|
|
- 'src/model/cli/cli.ts'
|
|
- 'src/model/input-readers/**'
|
|
- 'src/index.ts'
|
|
- 'src/types/game-ci-orchestrator.d.ts'
|
|
- 'action.yml'
|
|
- 'package.json'
|
|
pull_request:
|
|
branches: [main, 'release/**']
|
|
paths:
|
|
- 'src/model/orchestrator-plugin.ts'
|
|
- 'src/model/build-parameters.ts'
|
|
- 'src/model/input.ts'
|
|
- 'src/model/github.ts'
|
|
- 'src/model/cli/cli.ts'
|
|
- 'src/model/input-readers/**'
|
|
- 'src/index.ts'
|
|
- 'src/types/game-ci-orchestrator.d.ts'
|
|
- 'action.yml'
|
|
- 'package.json'
|
|
|
|
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: Build unity-builder
|
|
run: |
|
|
echo "Building unity-builder TypeScript..."
|
|
npx tsc
|
|
echo "✓ unity-builder compiles successfully"
|
|
|
|
- name: Run unity-builder tests
|
|
run: |
|
|
echo "Running unity-builder tests..."
|
|
npx jest --no-cache --passWithNoTests 2>&1 | tail -10
|
|
|
|
- name: Verify plugin loader returns undefined without orchestrator
|
|
run: |
|
|
echo "Checking plugin loader handles missing @game-ci/orchestrator..."
|
|
node -e "
|
|
const { loadOrchestrator, loadEnterpriseServices } = require('./lib/model/orchestrator-plugin');
|
|
(async () => {
|
|
const orch = await loadOrchestrator();
|
|
if (orch !== undefined) {
|
|
console.error('ERROR: loadOrchestrator should return undefined when package not installed');
|
|
process.exit(1);
|
|
}
|
|
console.log('✓ loadOrchestrator() returns undefined when package not installed');
|
|
|
|
const services = await loadEnterpriseServices();
|
|
if (services !== undefined) {
|
|
console.error('ERROR: loadEnterpriseServices should return undefined when package not installed');
|
|
process.exit(1);
|
|
}
|
|
console.log('✓ loadEnterpriseServices() returns undefined when package not installed');
|
|
})();
|
|
"
|
|
|
|
- name: Verify orchestrator type declarations exist
|
|
run: |
|
|
if [ -f "src/types/game-ci-orchestrator.d.ts" ]; then
|
|
echo "✓ Type declarations for @game-ci/orchestrator exist"
|
|
else
|
|
echo "::error::Missing type declarations: src/types/game-ci-orchestrator.d.ts"
|
|
exit 1
|
|
fi
|
|
|
|
- name: Build and install orchestrator standalone
|
|
working-directory: orchestrator-standalone
|
|
run: |
|
|
yarn install --frozen-lockfile
|
|
echo "Building orchestrator standalone..."
|
|
npx tsc
|
|
echo "✓ orchestrator standalone compiles successfully"
|
|
echo "Packing orchestrator as tarball..."
|
|
npm pack
|
|
|
|
- name: Run orchestrator standalone tests
|
|
working-directory: orchestrator-standalone
|
|
run: |
|
|
echo "Running orchestrator standalone tests..."
|
|
npx jest --no-cache 2>&1 | tail -10
|
|
|
|
- name: Verify plugin loader returns exports with orchestrator installed
|
|
run: |
|
|
echo "Installing orchestrator into unity-builder workspace..."
|
|
npm install ./orchestrator-standalone/game-ci-orchestrator-*.tgz --no-save
|
|
echo "Checking plugin loader returns defined exports..."
|
|
node -e "
|
|
const { loadOrchestrator, loadEnterpriseServices } = require('./lib/model/orchestrator-plugin');
|
|
(async () => {
|
|
const orch = await loadOrchestrator();
|
|
if (orch === undefined) {
|
|
console.error('ERROR: loadOrchestrator should return defined exports when package is installed');
|
|
process.exit(1);
|
|
}
|
|
if (typeof orch.run !== 'function') {
|
|
console.error('ERROR: loadOrchestrator().run should be a function');
|
|
process.exit(1);
|
|
}
|
|
console.log('✓ loadOrchestrator() returns defined exports with orchestrator installed');
|
|
|
|
const services = await loadEnterpriseServices();
|
|
if (services === undefined) {
|
|
console.error('ERROR: loadEnterpriseServices should return defined exports when package is installed');
|
|
process.exit(1);
|
|
}
|
|
console.log('✓ loadEnterpriseServices() returns defined exports with orchestrator installed');
|
|
})();
|
|
"
|