Files
open-multi-agent/.github/workflows/ci.yml
T

178 lines
7.0 KiB
YAML

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run lint
test:
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
node-version: [18, 20, 22]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
- run: npm ci
- run: npm test
coverage:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run test:coverage
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./packages/core/coverage/lcov.info
fail_ci_if_error: false
package:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- run: npm run build
- name: Smoke-test that the built entry points import and the CLI runs
working-directory: packages/core
run: |
node -e "Promise.all([import('./dist/index.js'), import('./dist/observability/index.js'), import('./dist/observability/file.js'), import('./dist/acp.js'), import('./dist/process.js'), import('./dist/mcp.js'), import('./dist/ai-sdk.js'), import('./dist/eval/index.js'), import('./dist/eval/file.js')]).then(() => console.log('entry points import OK')).catch((e) => { console.error(e); process.exit(1); })"
node dist/cli/oma.js help | grep -q "oma eval run"
echo "CLI help runs OK"
- name: Assert the create-oma-app template pins the current core version
run: |
core_version=$(jq -r .version packages/core/package.json)
for manifest in packages/create-oma-app/templates/*/package.json; do
pinned=$(jq -r '.dependencies["@open-multi-agent/core"]' "$manifest")
if [ "$pinned" != "$core_version" ]; then
echo "$manifest pins @open-multi-agent/core@$pinned but this repo's core is $core_version."
exit 1
fi
done
- name: Typecheck the create-oma-app template against core
run: npm run typecheck:template -w create-oma-app
- name: Assert the npm tarball ships exactly the expected files
working-directory: packages/core
run: |
paths=$(npm pack --dry-run --json | jq -r '.[0].files[].path')
unexpected=$(echo "$paths" | grep -vE '^(dist/|README\.md$|LICENSE$|package\.json$)' || true)
if [ -n "$unexpected" ]; then
echo "Unexpected files staged for the npm tarball:"
echo "$unexpected"
echo "Only dist/, README.md, LICENSE, package.json may ship."
exit 1
fi
missing=""
for f in dist/index.js dist/index.d.ts dist/observability/index.js dist/observability/index.d.ts dist/observability/file.js dist/observability/file.d.ts dist/cli/oma.js dist/acp.js dist/acp.d.ts dist/process.js dist/process.d.ts dist/mcp.js dist/mcp.d.ts dist/ai-sdk.js dist/ai-sdk.d.ts dist/eval/index.js dist/eval/index.d.ts dist/eval/file.js dist/eval/file.d.ts; do
echo "$paths" | grep -qxF "$f" || missing="$missing $f"
done
if [ -n "$missing" ]; then
echo "Required entry points missing from the npm tarball:$missing"
echo "Either the build did not run or an entry was dropped from package.json \"files\"."
exit 1
fi
- name: Assert the create-oma-app tarball ships dist + template
working-directory: packages/create-oma-app
run: |
paths=$(npm pack --dry-run --json | jq -r '.[0].files[].path')
unexpected=$(echo "$paths" | grep -vE '^(dist/|template/|templates/|README\.md$|LICENSE$|package\.json$)' || true)
if [ -n "$unexpected" ]; then
echo "Unexpected files staged for the create-oma-app tarball:"
echo "$unexpected"
echo "Only dist/, template/, README.md, LICENSE, package.json may ship."
exit 1
fi
missing=""
for f in dist/index.js dist/scaffold.js templates/demo/package.json templates/pr-review/src/index.ts templates/security/src/index.ts template/src/runtime.ts template/src/report.ts template/_env.example template/_env.ollama template/_gitignore; do
echo "$paths" | grep -qxF "$f" || missing="$missing $f"
done
if [ -n "$missing" ]; then
echo "Required files missing from the create-oma-app tarball:$missing"
echo "The scaffolder needs its template/ to function once published."
exit 1
fi
- name: Smoke-test that the otel entry point imports
working-directory: packages/otel
run: node -e "import('./dist/index.js').then(() => console.log('otel entry point imports OK')).catch((e) => { console.error(e); process.exit(1); })"
- name: Assert the otel tarball ships exactly the expected files
working-directory: packages/otel
run: |
paths=$(npm pack --dry-run --json | jq -r '.[0].files[].path')
unexpected=$(echo "$paths" | grep -vE '^(dist/|README\.md$|LICENSE$|package\.json$)' || true)
if [ -n "$unexpected" ]; then
echo "Unexpected files staged for the @open-multi-agent/otel tarball:"
echo "$unexpected"
echo "Only dist/, README.md, LICENSE, package.json may ship."
exit 1
fi
missing=""
for f in dist/index.js dist/index.d.ts; do
echo "$paths" | grep -qxF "$f" || missing="$missing $f"
done
if [ -n "$missing" ]; then
echo "Required entry points missing from the @open-multi-agent/otel tarball:$missing"
echo "Either the build did not run or an entry was dropped from package.json \"files\"."
exit 1
fi
- name: Run public observability examples without network or API keys
run: npm run test:observability-examples
- name: Run tolerant same-host observability regression gate
run: npm run bench:observability:ci
- name: Install real core and OTel tarballs in clean consumers
run: npm run test:observability-pack
scaffold-e2e:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: End-to-end scaffold smoke test (pack -> generate -> install -> run gate)
run: npm run test:scaffold