---
title: "Ghost: .github/workflows/ci.yml"
description: "Example from .github/workflows/ci.yml: GitHub Actions CI workflow for running typecheck and tests on push to main and every pull request."
---

# .github/workflows/ci.yml

<Note>
**Ghost doc** -- an abridged, illustrative excerpt of [`.github/workflows/ci.yml`](https://github.com/smithersai/smithers/blob/main/.github/workflows/ci.yml). The live file is the source of truth; it runs an ubuntu + windows matrix with more typecheck and test steps than shown here.
</Note>

## Source

```yaml
name: CI

on:
  pull_request:
  push:
    branches:
      - main

jobs:
  typecheck:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6.0.2
      - uses: pnpm/action-setup@v6.0.8
        with:
          version: 10.10.0
          run_install: false
      - uses: actions/setup-node@v6.4.0
        with:
          node-version: 22
          cache: pnpm
      - run: pnpm install --frozen-lockfile
      - run: pnpm check:effect
      - run: pnpm check:deps
      - run: pnpm -r typecheck
      - run: pnpm --filter ./.smithers typecheck

  test:
    runs-on: ubuntu-latest
    timeout-minutes: 20
    steps:
      - uses: actions/checkout@v6.0.2
      - uses: pnpm/action-setup@v6.0.8
        with:
          version: 10.10.0
          run_install: false
      - uses: actions/setup-node@v6.4.0
        with:
          node-version: 22
          cache: pnpm
      - uses: oven-sh/setup-bun@v2.2.0
        with:
          bun-version: 1.3.13
      - run: pnpm install --frozen-lockfile
      - run: pnpm test
```

## Notes

- Uses pnpm/Node as the primary toolchain; `oven-sh/setup-bun` is installed only in the test job to provide the bun runtime for `pnpm test`.
- `--frozen-lockfile` pins exact dependency versions.
- Typecheck and tests run as separate jobs on independent runners -- type errors surface even if tests pass.
- Push triggers are filtered to the main branch; pull requests trigger on any branch.
