Skip to content

CI: Extract unit tests into independent workflow #19676

@chargome

Description

@chargome

Linear ticket: https://linear.app/getsentry/issue/JS-1879

Depends on: #19677 (build output caching)
Parent: #19671

Goal

Extract unit test jobs from build.yml into an independent ci-unit-tests.yml workflow. This includes:

  • job_browser_unit_tests
  • job_node_unit_tests (×4 Node versions)
  • job_bun_unit_tests
  • job_deno_unit_tests

This is the last extraction since unit tests are the least flaky and fastest to complete, so re-run wait times are least painful.

New workflow: ci-unit-tests.yml

name: 'CI: Unit Tests'
on:
  push:
    branches: [develop, master, v9, v8, release/**]
  pull_request:
  merge_group:
    types: [checks_requested]
  workflow_dispatch:

Jobs

  1. restore_build — uses .github/actions/restore-build (from CI: Build output caching + cross-workflow restore-cache action #19677)
  2. browser_unit_tests — Vitest browser tests
  3. node_unit_tests — matrix: Node 18/20/22/24
  4. bun_unit_tests — conditional on @sentry/bun changes
  5. deno_unit_tests — conditional on @sentry/deno changes
  6. unit_tests_gate — gate job named Unit Tests Passed

Conditional execution

Bun and Deno tests use changed_bun and changed_deno flags. This workflow needs the same detection.

Transition steps

  1. Create ci-unit-tests.yml. Unit tests run in both build.yml and ci-unit-tests.yml (dual-running).
  2. Verify stability over several days/PRs.
  3. Ruleset change (requires admin): Add Unit Tests Passed as required status check to all 4 rulesets.
  4. Remove unit test jobs from build.yml and from job_required_jobs_passed needs list.
  5. At this point build.yml only contains build, lint, and check jobs. Rename workflow to CI: Build & Lint and gate job to Build & Lint Passed. Update rulesets accordingly.

Concurrency

concurrency:
  group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
  cancel-in-progress: true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions