Repository navigation
feat: Schedules #2286
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: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| merge_group: | |
| types: [checks_requested] | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| detect-changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| outputs: | |
| packages: ${{ steps.packages.outputs.list }} | |
| chart: ${{ steps.filter.outputs.chart }} | |
| store: ${{ steps.filter.outputs.store }} | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v7 | |
| - name: Detect path changes | |
| uses: dorny/paths-filter@v4.0.3 | |
| id: filter | |
| with: | |
| # Shared roots on every package filter so path-gated tests still run when: | |
| # - package.json: root test:* entrypoints change | |
| # - pnpm-workspace.yaml: workspace membership/graph changes | |
| # - tsconfig.base.json: shared TS settings affect package tests | |
| # - .github/workflows/ci.yml: this workflow's package matrix/steps change | |
| filters: | | |
| trueforge-core: | |
| - 'packages/trueforge-core/**' | |
| - 'package.json' | |
| - 'pnpm-workspace.yaml' | |
| - 'tsconfig.base.json' | |
| - '.github/workflows/ci.yml' | |
| trueforge: | |
| - 'packages/trueforge/**' | |
| - 'package.json' | |
| - 'pnpm-workspace.yaml' | |
| - 'tsconfig.base.json' | |
| - '.github/workflows/ci.yml' | |
| frontend: | |
| - 'packages/frontend/**' | |
| # trueforge-sdk is workspace:* (no version bump); SDK-only PRs must still run FE checks. | |
| - 'packages/trueforge-sdk/**' | |
| - 'package.json' | |
| - 'pnpm-workspace.yaml' | |
| - 'tsconfig.base.json' | |
| - '.github/workflows/ci.yml' | |
| trueforge-ui: | |
| - 'packages/trueforge-ui/**' | |
| - 'package.json' | |
| - 'pnpm-workspace.yaml' | |
| - 'tsconfig.base.json' | |
| - '.github/workflows/ci.yml' | |
| store: | |
| - 'packages/trueforge/src/db/**' | |
| - 'packages/trueforge/tests/db/**' | |
| - 'packages/trueforge/jest.store.postgres.config.cjs' | |
| - 'packages/trueforge/jest.store.sqlite.config.cjs' | |
| - 'packages/trueforge/package.json' | |
| - 'packages/trueforge-core/package.json' | |
| - 'packages/trueforge-core/src/agent-session/models/**' | |
| - 'packages/trueforge-core/src/agent-session/schemas/**' | |
| - 'packages/trueforge-core/src/agent-session/store/**' | |
| - 'packages/trueforge-core/tests/agent-session/store/**' | |
| - 'packages/trueforge-core/tests/agent-session/testHelpers.ts' | |
| - 'package.json' | |
| - 'pnpm-workspace.yaml' | |
| - 'tsconfig.base.json' | |
| - '.github/workflows/ci.yml' | |
| chart: | |
| - 'charts/trueforge/**' | |
| - 'Dockerfile' | |
| - 'Dockerfile.dev' | |
| - 'package.json' | |
| - '.github/workflows/ci.yml' | |
| - name: Build package matrix | |
| id: packages | |
| env: | |
| TRUEFORGE_CORE: ${{ steps.filter.outputs['trueforge-core'] }} | |
| TRUEFORGE: ${{ steps.filter.outputs.trueforge }} | |
| FRONTEND: ${{ steps.filter.outputs.frontend }} | |
| TRUEFORGE_UI: ${{ steps.filter.outputs['trueforge-ui'] }} | |
| run: | | |
| node <<'EOF' >> "$GITHUB_OUTPUT" | |
| const changedPackages = []; | |
| if (process.env.TRUEFORGE_CORE === 'true') changedPackages.push('trueforge-core'); | |
| if (process.env.TRUEFORGE === 'true') changedPackages.push('trueforge'); | |
| if (process.env.FRONTEND === 'true') changedPackages.push('frontend'); | |
| if (process.env.TRUEFORGE_UI === 'true') changedPackages.push('trueforge-ui'); | |
| console.log(`list=${JSON.stringify(changedPackages)}`); | |
| EOF | |
| # Always-on: format + lint cover the whole tree (incl. roots outside packages/*); | |
| # typecheck/build stay always-on. Per-package jobs only run tests. | |
| # Order matters for fail-fast and lint correctness: | |
| # - format first (cheapest signal) | |
| # - typecheck next (types + sdk/ui pretypecheck so .d.ts exist) | |
| # - lint after typecheck (type-aware eslint resolves workspace packages via dist) | |
| # - build last (full emit; not required for lint, still always-on as a ship gate) | |
| typecheck-and-build: | |
| name: Format, Typecheck, Lint and Build | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '24' | |
| cache: 'pnpm' | |
| - name: Cache prettier | |
| uses: actions/cache@v6.1.0 | |
| with: | |
| path: .prettiercache | |
| # Project tsconfigs only (plugin reads them); !node_modules so post-install **/ globs stay bounded. | |
| key: prettier-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml', '.prettierrc', '.prettierignore', 'package.json', '**/tsconfig*.json', '!**/node_modules/**') }} | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Format | |
| run: pnpm format:check | |
| - name: Typecheck | |
| run: pnpm typecheck | |
| # After typecheck so trueforge-ui and sdk .d.ts exist for type-aware eslint. | |
| - name: Lint | |
| run: pnpm lint:ci | |
| - name: Build | |
| run: pnpm build | |
| # Path-gated tests only — format/lint are covered by the global job above. | |
| package-checks: | |
| name: Package (${{ matrix.package }}) | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.packages != '[]' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 25 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| package: ${{ fromJSON(needs.detect-changes.outputs.packages) }} | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '24' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Test | |
| run: pnpm "test:${{ matrix.package }}" | |
| chart-checks: | |
| name: Helm Chart | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.chart == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '24' | |
| - name: Install Helm | |
| uses: azure/setup-helm@v5 | |
| with: | |
| version: v3.16.4 | |
| - name: Build chart dependencies | |
| run: pnpm chart:deps | |
| - name: Lint chart | |
| run: pnpm chart:lint | |
| # Store contract suites when store paths change. Parallel with typecheck-and-build. | |
| store-tests: | |
| name: Store Tests | |
| needs: detect-changes | |
| if: needs.detect-changes.outputs.store == 'true' | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| services: | |
| postgres: | |
| image: postgres:17-alpine | |
| env: | |
| POSTGRES_USER: proto | |
| POSTGRES_PASSWORD: proto | |
| POSTGRES_DB: proto | |
| ports: | |
| - 55432:5432 | |
| options: >- | |
| --health-cmd "pg_isready -U proto -d proto" | |
| --health-interval 5s | |
| --health-timeout 5s | |
| --health-retries 10 | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v7 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: '24' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: SQLite store tests | |
| run: pnpm test:store:sqlite | |
| - name: Postgres store tests | |
| env: | |
| SESSION_STORE_TEST_PG_URL: postgres://proto:proto@localhost:55432/proto | |
| run: pnpm test:store:postgres | |
| # https://github.com/marketplace/actions/alls-green#why | |
| check: | |
| if: always() | |
| needs: | |
| - detect-changes | |
| - typecheck-and-build | |
| - package-checks | |
| - chart-checks | |
| - store-tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Decide whether the needed jobs succeeded or failed | |
| env: | |
| DETECT_CHANGES: ${{ needs.detect-changes.result }} | |
| TYPECHECK_AND_BUILD: ${{ needs.typecheck-and-build.result }} | |
| PACKAGE_CHECKS: ${{ needs.package-checks.result }} | |
| CHART_CHECKS: ${{ needs.chart-checks.result }} | |
| STORE_TESTS: ${{ needs.store-tests.result }} | |
| run: | | |
| ok() { [ "$1" = success ] || [ "$1" = skipped ]; } | |
| echo "detect-changes=$DETECT_CHANGES typecheck-and-build=$TYPECHECK_AND_BUILD package-checks=$PACKAGE_CHECKS chart-checks=$CHART_CHECKS store-tests=$STORE_TESTS" | |
| [ "$DETECT_CHANGES" = success ] || exit 1 | |
| [ "$TYPECHECK_AND_BUILD" = success ] || exit 1 | |
| ok "$PACKAGE_CHECKS" || exit 1 | |
| ok "$CHART_CHECKS" || exit 1 | |
| ok "$STORE_TESTS" || exit 1 |