Skip to content

feat(command): add channels to cmd-k and show task filing #8060

feat(command): add channels to cmd-k and show task filing

feat(command): add channels to cmd-k and show task filing #8060

Workflow file for this run

name: Run unit and integration tests
on:
pull_request:
concurrency:
group: test-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
code: ${{ steps.filter.outputs.code }}
workflow: ${{ steps.filter.outputs.workflow }}
steps:
- name: Detect relevant changes
id: filter
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
with:
predicate-quantifier: every
filters: |
# Wider excludes than code-quality.yml, which keeps .github/scripts
# and .vscode/.claude in scope because Biome lints them.
code:
- "!**/*.md"
- "!docs/**"
- "!.github/**"
- "!.vscode/**"
- "!.claude/**"
- "!.husky/**"
- "!LICENSE"
- "!.gitignore"
- "!.env.example"
workflow:
- ".github/workflows/test.yml"
unit-test:
needs: changes
# Fail closed: if change detection itself failed, run instead of skipping.
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.code == 'true' || needs.changes.outputs.workflow == 'true') }}
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Rebuild native modules for Node
run: node scripts/rebuild-better-sqlite3-node.mjs
- name: Build dependencies
run: pnpm --filter @posthog/electron-trpc build
- name: Run tests
run: pnpm test
integration-test:
needs: changes
# Fail closed: if change detection itself failed, run instead of skipping.
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.code == 'true' || needs.changes.outputs.workflow == 'true') }}
runs-on: macos-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup pnpm
uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4.3.0
- name: Setup Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: "pnpm"
- name: Cache Playwright browsers
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
id: playwright-cache
with:
path: ~/Library/Caches/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
playwright-${{ runner.os }}-
- name: Cache Electron binary
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/Library/Caches/electron
key: electron-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
electron-${{ runner.os }}-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Rebuild better-sqlite3 for Electron
run: node scripts/rebuild-better-sqlite3-electron.mjs
- name: Build packages
run: |
pnpm --filter @posthog/electron-trpc build &
pnpm --filter @posthog/platform build &
pnpm --filter @posthog/shared build
pnpm --filter @posthog/git build
pnpm --filter @posthog/enricher build
pnpm --filter agent build &
wait
- name: Build native modules
run: pnpm --filter code run build-native
- name: Package Electron app
run: pnpm --filter code run package
env:
NODE_OPTIONS: "--max-old-space-size=6144"
- name: Install Playwright
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm --filter code exec playwright install --with-deps chromium
- name: Run E2E smoke tests
run: pnpm --filter code run test:e2e
env:
CI: true
- name: Upload Playwright report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
if: failure()
with:
name: playwright-report
path: apps/code/playwright-report/
retention-days: 7