Skip to content

Sharing Results from CI

Your CI already runs your test suite on main. With Squeal’s GitHub Action (hearsay-tools/squeal/ci@v0), CI records each test file’s content-keyed result and publishes it to a Git ref (refs/squeal/<commit>).

When a developer or agent starts a branch from that main commit, Squeal fetches those results automatically — any test file with identical inputs and a compatible environment is already current and does not need to run locally. Supports Vitest and node:test.

  1. Pin one exact Node version

    Add .node-version at the repository root (for example 26.13.0). A shared result counts only on the Node version that recorded it; Squeal’s local daemon uses the pinned version when installed.

  2. Enable shared.ref in squeal.config.json

    Without shared.ref, developers’ Squeal daemons fetch nothing:

    {
    "shared": {
    "ref": "refs/squeal",
    "lookAgain": {
    "everySeconds": 30,
    "forSeconds": 600
    }
    }
    }

    If a developer checks out a brand-new main commit whose CI export is still finishing, lookAgain re-checks every 30 s for up to 10 min and imports results as soon as they appear (set "forSeconds": 0 to check only once).

  3. Record and publish in GitHub Actions

    name: Tests
    on:
    push:
    branches: [main]
    pull_request:
    permissions:
    contents: read
    jobs:
    test:
    runs-on: ubuntu-24.04
    strategy:
    matrix:
    shard: [1, 2, 3]
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-node@v4
    with:
    node-version-file: .node-version
    - run: pnpm install --frozen-lockfile
    - uses: hearsay-tools/squeal/ci@v0
    - run: squeal ci record --out "$RUNNER_TEMP/squeal-parts" -- pnpm exec vitest run --shard=${{ matrix.shard }}/3
    - uses: actions/upload-artifact@v4
    if: github.event_name == 'push'
    with:
    name: squeal-parts-${{ matrix.shard }}
    path: ${{ runner.temp }}/squeal-parts/
    retention-days: 3
    node-test:
    runs-on: ubuntu-24.04
    steps:
    - uses: actions/checkout@v4
    - uses: actions/setup-node@v4
    with:
    node-version-file: .node-version
    - run: pnpm install --frozen-lockfile
    - uses: hearsay-tools/squeal/ci@v0
    - run: >-
    squeal ci record --out "$RUNNER_TEMP/squeal-parts" --
    node --test
    --test-reporter=spec --test-reporter-destination=stdout
    --test-reporter="$SQUEAL_NODE_TEST_REPORTER" --test-reporter-destination=stderr
    test/*.test.mjs
    - uses: actions/upload-artifact@v4
    if: github.event_name == 'push'
    with:
    name: squeal-parts-node-test
    path: ${{ runner.temp }}/squeal-parts/
    retention-days: 3
    squeal-export:
    needs: [test, node-test]
    if: github.event_name == 'push'
    runs-on: ubuntu-24.04
    permissions:
    contents: write
    steps:
    - uses: actions/checkout@v4
    with:
    fetch-depth: 0
    - uses: actions/setup-node@v4
    with:
    node-version-file: .node-version
    - run: pnpm install --frozen-lockfile
    - uses: hearsay-tools/squeal/ci@v0
    - uses: actions/download-artifact@v4
    with:
    pattern: squeal-parts-*
    path: ${{ runner.temp }}/squeal-parts
    merge-multiple: true
    - run: squeal ci export --parts "$RUNNER_TEMP/squeal-parts" --out "$RUNNER_TEMP/squeal-results.json.gz"
    - run: squeal ci publish "$RUNNER_TEMP/squeal-results.json.gz" --keep 100
  • Token isolation: Split squeal-export into two jobs so dependency install scripts never run with contents: write. Job 1 (contents: read) installs dependencies, runs squeal ci export, and uploads squeal-results.json.gz. Job 2 (contents: write) downloads that artifact and runs only squeal ci publish (no npm/pnpm install).
  • Merge queues: Trigger part uploads and export on merge_group instead of push, checking out github.event.merge_group.head_sha. Making export a required check ensures refs/squeal/<commit> is published before main moves, preventing local runs from starting before CI results arrive.
  • Pinning the action: hearsay-tools/squeal/ci@v0 follows compatible releases automatically. To pin an exact commit SHA, use hearsay-tools/squeal/ci@<sha> # v0 (compatible with Renovate helpers:pinGitHubActionDigests and Dependabot via v<version> tags).