test(lib): add comprehensive unit tests for resolve-subagent-path (#328) #1323
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| quality: | |
| runs-on: ubuntu-latest | |
| env: | |
| FAILPROOFAI_TELEMETRY_DISABLED: "1" | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/cache@v6 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: bun-${{ runner.os }}-${{ hashFiles('bun.lockb') }} | |
| restore-keys: bun-${{ runner.os }}- | |
| - name: Install dependencies | |
| uses: nick-fields/retry@v4 | |
| with: | |
| max_attempts: 3 | |
| timeout_minutes: 5 | |
| command: bun install --frozen-lockfile | |
| - name: Check version consistency | |
| run: | | |
| ROOT_VERSION=$(jq -r .version package.json) | |
| echo "Root version: $ROOT_VERSION" | |
| MISMATCH=0 | |
| for pkg in packages/*/package.json; do | |
| [ -f "$pkg" ] || continue | |
| PKG_VERSION=$(jq -r .version "$pkg") | |
| if [ "$PKG_VERSION" != "$ROOT_VERSION" ]; then | |
| echo "::error file=$pkg::Version mismatch: $pkg has $PKG_VERSION, expected $ROOT_VERSION" | |
| MISMATCH=1 | |
| fi | |
| done | |
| # Check optionalDependencies in wrapper | |
| for dep_version in $(jq -r '.optionalDependencies // {} | values[]' packages/wrapper/package.json 2>/dev/null || true); do | |
| if [ "$dep_version" != "$ROOT_VERSION" ]; then | |
| echo "::error file=packages/wrapper/package.json::Dependency version mismatch: $dep_version, expected $ROOT_VERSION" | |
| MISMATCH=1 | |
| fi | |
| done | |
| if [ "$MISMATCH" -eq 1 ]; then | |
| echo "::error::Version mismatch detected across package.json files" | |
| exit 1 | |
| fi | |
| echo "All versions match: $ROOT_VERSION" | |
| - name: Lint | |
| uses: nick-fields/retry@v4 | |
| with: | |
| max_attempts: 3 | |
| timeout_minutes: 5 | |
| command: bun run lint | |
| - name: Type check | |
| uses: nick-fields/retry@v4 | |
| with: | |
| max_attempts: 3 | |
| timeout_minutes: 5 | |
| command: bunx tsc --noEmit | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| env-config: | |
| - { name: default, env: {} } | |
| - { name: log-debug, env: { FAILPROOFAI_LOG_LEVEL: debug } } | |
| - { name: hook-log-file, env: { FAILPROOFAI_HOOK_LOG_FILE: "1" } } | |
| env: | |
| FAILPROOFAI_TELEMETRY_DISABLED: "1" | |
| NEXT_TELEMETRY_DISABLED: "1" | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/cache@v6 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: bun-${{ runner.os }}-${{ hashFiles('bun.lockb') }} | |
| restore-keys: bun-${{ runner.os }}- | |
| - name: Install dependencies | |
| uses: nick-fields/retry@v4 | |
| with: | |
| max_attempts: 3 | |
| timeout_minutes: 5 | |
| command: bun install --frozen-lockfile | |
| - name: Test (${{ matrix.env-config.name }}) | |
| uses: nick-fields/retry@v4 | |
| env: ${{ matrix.env-config.env }} | |
| with: | |
| max_attempts: 3 | |
| timeout_minutes: 10 | |
| command: bun run test:run | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| FAILPROOFAI_TELEMETRY_DISABLED: "1" | |
| NEXT_TELEMETRY_DISABLED: "1" | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/cache@v6 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: bun-${{ runner.os }}-${{ hashFiles('bun.lockb') }} | |
| restore-keys: bun-${{ runner.os }}- | |
| - name: Install dependencies | |
| uses: nick-fields/retry@v4 | |
| with: | |
| max_attempts: 3 | |
| timeout_minutes: 5 | |
| command: bun install --frozen-lockfile | |
| - name: Build | |
| uses: nick-fields/retry@v4 | |
| with: | |
| max_attempts: 3 | |
| timeout_minutes: 10 | |
| command: bun run build | |
| docs: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/cache@v6 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: bun-${{ runner.os }}-${{ hashFiles('bun.lockb') }} | |
| restore-keys: bun-${{ runner.os }}- | |
| - name: Install dependencies | |
| uses: nick-fields/retry@v4 | |
| with: | |
| max_attempts: 3 | |
| timeout_minutes: 5 | |
| command: bun install --frozen-lockfile | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: 22 | |
| - name: Install Mintlify CLI | |
| run: npm install -g mintlify | |
| # Validates docs.json structure + nav-link resolution. | |
| - name: Validate docs config | |
| working-directory: docs | |
| run: mintlify validate | |
| # Parses every MDX page with the same engine Mintlify runs at deploy | |
| # time. `mintlify validate` does NOT parse page content, so a syntax | |
| # error (e.g. a translation that breaks a JSX tag or injects a `{#id}` | |
| # heading anchor) passes that step but fails the post-merge deploy. | |
| # This catches it on the PR instead. | |
| - name: Validate MDX pages parse | |
| run: bun run validate:mdx | |
| test-e2e: | |
| runs-on: ubuntu-latest | |
| env: | |
| FAILPROOFAI_TELEMETRY_DISABLED: "1" | |
| NEXT_TELEMETRY_DISABLED: "1" | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/cache@v6 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: bun-${{ runner.os }}-${{ hashFiles('bun.lockb') }} | |
| restore-keys: bun-${{ runner.os }}- | |
| - name: Install dependencies | |
| uses: nick-fields/retry@v4 | |
| with: | |
| max_attempts: 3 | |
| timeout_minutes: 5 | |
| command: bun install --frozen-lockfile | |
| - name: Build E2E fixtures | |
| run: bun build src/index.ts --outdir dist --target node --format cjs | |
| - name: E2E Hook Tests | |
| uses: nick-fields/retry@v4 | |
| with: | |
| max_attempts: 2 | |
| timeout_minutes: 10 | |
| command: bun run test:e2e |