Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

chore(ci): typecheck, test and lint hog on every change to it (#129831)

Rafael Audibert1239ed6d6d36
diff --git a/.github/workflows/ci-hog.yml b/.github/workflows/ci-hog.yml
new file mode 100644
index 000000000000..c26d4f18a59a
--- /dev/null
+++ b/.github/workflows/ci-hog.yml
@@ -0,0 +1,56 @@
+name: hog CI
+
+# hog is the Bun CLI in hog/. Nothing else in CI typechecks, tests or lints it, so a change there
+# runs only this workflow. It is not a required check, so a trigger `paths:` filter is safe.
+on:
+ pull_request:
+ paths:
+ - 'hog/**'
+ # hog imports its types from the MCP package's CLI library.
+ - 'services/mcp/src/cli/library-types.ts'
+ # The lockfile and the workspace catalog decide which dependencies hog installs.
+ - 'pnpm-lock.yaml'
+ - 'pnpm-workspace.yaml'
+ - '.oxlintrc.json'
+ - '.github/workflows/ci-hog.yml'
+ workflow_dispatch:
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}
+
+permissions:
+ contents: read
+
+jobs:
+ hog:
+ name: hog typecheck, tests and lint
+ runs-on: ubuntu-24.04
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+ with:
+ persist-credentials: false
+
+ # The root package brings oxlint. `@posthog/hog...` brings hog and the workspace
+ # packages it depends on.
+ - name: Install pnpm dependencies
+ uses: ./.github/actions/pnpm-install
+ with:
+ install-command: pnpm --filter=@posthog/root --filter='@posthog/hog...' install --frozen-lockfile
+
+ - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
+ with:
+ # The version the flox environment pins for hog.
+ bun-version: 1.4.2
+
+ - name: Typecheck
+ working-directory: hog
+ run: pnpm run typecheck
+
+ - name: Test
+ working-directory: hog
+ run: bun test
+
+ - name: Lint
+ run: pnpm exec oxlint --quiet hog