Skip to content

fix(core): Use wall clock for structured log timestamps #52683

fix(core): Use wall clock for structured log timestamps

fix(core): Use wall clock for structured log timestamps #52683

Workflow file for this run

name: 'CI: Build & Test'
on:
push:
branches:
- develop
- master
- v10
- v9
- v8
- release/**
pull_request:
merge_group:
types: [checks_requested]
workflow_dispatch:
inputs:
commit:
description: If the commit you want to test isn't the head of a branch, provide its SHA here
required: false
schedule:
# Run every day at midnight (without cache)
- cron: '0 0 * * *'
# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
CACHED_DEPENDENCY_PATHS: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/packages/*/node_modules
${{ github.workspace }}/dev-packages/*/node_modules
~/.cache/mongodb-binaries/
# DEPENDENCY_CACHE_KEY: can't be set here because we don't have access to yarn.lock
# build-output artifact paths are computed in job_build (step output from
# yarn ci:print-build-artifact-paths — Nx merged outputs for build:transpile, and build:types).
# upload-artifact globs drop the path through the first `*` (see upload-artifact
# README). Tarballs therefore land in the artifact as <pkg>/*.tgz; download
# build-tarball-output into packages/ so they resolve to packages/<pkg>/*.tgz.
TARBALL_ARTIFACT_GLOB: packages/*/*.tgz
TARBALL_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
BUILD_LAYER_PATH: ${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless
# Same glob / download split as TARBALL_ARTIFACT_*: upload-artifact strips the path through
# the first `*`, so bundle trees are stored as <pkg>/build/bundles/...; download into packages/.
BUNDLE_ARTIFACT_GLOB: packages/*/build/bundles
BUNDLE_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
NX_CACHE_KEY: nx-Linux-${{ github.head_ref || github.ref }}-${{ github.run_id }}
# https://bsky.app/profile/joyeecheung.bsky.social/post/3lhy6o54fo22h
# Apparently some of our CI failures are attributable to a corrupt v8 cache, causing v8 failures with: "Check failed: current == end_slot_index.".
# This option both controls the `v8-compile-cache-lib` and `v8-compile-cache` packages.
DISABLE_V8_COMPILE_CACHE: '1'
jobs:
job_get_metadata:
uses: ./.github/workflows/ci-metadata.yml
name: Get CI Metadata
with:
head_commit: ${{ github.event.inputs.commit || github.sha }}
permissions:
pull-requests: read
job_build:
name: Build
needs: job_get_metadata
runs-on: ubuntu-24.04
timeout-minutes: 15
if: |
needs.job_get_metadata.outputs.changed_any_code == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true' ||
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false' && needs.job_get_metadata.outputs.changed_any_code == 'true')
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check for Affected Nx Projects
uses: ./.github/actions/nx-affected-list
id: checkForAffected
if: github.event_name == 'pull_request'
with:
base: ${{ github.event.pull_request.base.sha }}
head: ${{ env.HEAD_COMMIT }}
- name: Build packages
run: yarn build:ci
- name: Compute build artifact paths from Nx
id: nx_build_paths
run: |
{
echo 'paths<<EOF'
yarn --silent ci:print-build-artifact-paths
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Store NX cache
uses: actions/cache/save@v5
# Only cache this per-PR to speed up CI.
if: github.event_name == 'pull_request'
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-output
path: ${{ steps.nx_build_paths.outputs.paths }}
retention-days: 4
compression-level: 6
overwrite: true
- name: Determine which test applications should be run
id: matrix
run:
yarn --silent ci:build-matrix --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
- name: Determine which optional E2E test applications should be run
id: matrix-optional
run:
yarn --silent ci:build-matrix-optional --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
outputs:
dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }}
changed_node_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/node-integration-tests') }}
changed_node:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/node') }}
changed_deno:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/deno') }}
changed_bun:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/bun') }}
changed_bun_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bun-integration-tests') }}
changed_deno_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/deno-integration-tests') }}
changed_browser_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/browser-integration-tests') }}
changed_cloudflare_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/cloudflare-integration-tests') }}
changed_bundler_plugin_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bundler-plugin-integration-tests') }}
changed_aws_serverless:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/aws-serverless') }}
e2e-matrix: ${{ steps.matrix.outputs.matrix }}
e2e-matrix-optional: ${{ steps.matrix-optional.outputs.matrix }}
job_build_layer:
name: Build Lambda layer
needs: [job_get_metadata, job_build]
if:
needs.job_build.outputs.changed_aws_serverless == 'true' || contains(needs.job_build.outputs.e2e-matrix,
'aws-serverless') || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build Lambda layer
run: yarn build:layer
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
retention-days: 4
compression-level: 6
overwrite: true
job_build_bundles:
name: Build bundles
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build bundles
run: yarn build:bundle
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_GLOB }}
retention-days: 4
compression-level: 6
overwrite: true
job_check_branches:
name: Check PR branches
needs: job_get_metadata
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: PR is opened against master
uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0
if: ${{ github.base_ref == 'master' && !startsWith(github.head_ref, 'prepare-release/') }}
with:
message: |
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
job_size_check:
name: Size Check
needs: [job_get_metadata, job_build, job_build_bundles]
timeout-minutes: 15
runs-on: ubuntu-24.04
if:
github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Check bundle sizes
uses: ./dev-packages/size-limit-gh-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Only run comparison against develop if this is a PR
comparison_branch: ${{ (github.event_name == 'pull_request' && github.base_ref) || ''}}
job_lint:
name: Lint
# Even though the linter only checks source code, not built code, it needs the built code in order check that all
# inter-package dependencies resolve cleanly.
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Lint source files
run: yarn lint
- name: Lint for ES compatibility
run: yarn lint:es-compatibility
- name: Lint types
run: yarn lint:types
job_check_lockfile:
name: Check lockfile
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
if: |
needs.job_get_metadata.outputs.changed_deps == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install dependencies
run: yarn install --ignore-engines
- name: Check that yarn.lock is stable
run: |
if ! git diff --exit-code yarn.lock; then
echo "::error::yarn.lock has uncommitted changes after running 'yarn install'. Please run 'yarn install' locally and commit the updated yarn.lock."
exit 1
fi
- name: Check for duplicate dependencies in lockfile
run: yarn dedupe-deps:check
job_check_format:
name: Check file formatting
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check file formatting
run: yarn format:check
job_circular_dep_check:
name: Circular Dependency Check
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run madge
run: yarn circularDepCheck
job_artifacts:
name: Upload Artifacts
needs: [job_get_metadata, job_build, job_build_layer, job_build_bundles, job_build_tarballs]
runs-on: ubuntu-24.04
# Build artifacts are only needed for releasing workflow.
if: needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Archive artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}
retention-days: 90
path: |
${{ github.workspace }}/packages/browser/build/bundles/**
${{ github.workspace }}/packages/replay-internal/build/bundles/**
${{ github.workspace }}/packages/replay-canvas/build/bundles/**
${{ github.workspace }}/packages/feedback/build/bundles/**
${{ github.workspace }}/packages/**/*.tgz
${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless/*.zip
job_browser_unit_tests:
name: Browser Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:browser --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
- name: Run all tests
run: yarn test:ci:browser
if: github.event_name != 'pull_request'
job_bun_unit_tests:
name: Bun Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
yarn test:ci:bun
job_deno_unit_tests:
name: Deno Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
cd packages/deno
yarn build
yarn test
job_node_unit_tests:
name: Node (${{ matrix.node }}) Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:node --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
- name: Run all tests
run: yarn test:ci:node
if: github.event_name != 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
job_browser_playwright_tests:
name:
Playwright ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}',
matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04-large-js
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
bundle:
- esm
- bundle
- bundle_min
- bundle_logs_metrics
- bundle_replay
- bundle_replay_logs_metrics
- bundle_tracing
- bundle_tracing_logs_metrics
- bundle_tracing_replay
- bundle_tracing_replay_logs_metrics
- bundle_tracing_replay_feedback
- bundle_tracing_replay_feedback_logs_metrics
- bundle_tracing_replay_feedback_logs_metrics_min
project:
- chromium
include:
# Only check all projects for full bundle
# We also shard the tests as they take the longest
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'webkit'
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'firefox'
- bundle: esm
project: chromium
shard: 1
shards: 4
- bundle: esm
project: chromium
shard: 2
shards: 4
- bundle: esm
project: chromium
shard: 3
shards: 4
- bundle: esm
project: chromium
shard: 4
shards: 4
exclude:
# Do not run the un-sharded esm tests
- bundle: esm
project: 'chromium'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: ${{ matrix.project }}
- name: Run Playwright tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
working-directory: dev-packages/browser-integration-tests
run:
yarn test:all${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard &&
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name:
playwright-traces-job_browser_playwright_tests-${{ matrix.bundle}}-${{matrix.project}}-${{matrix.shard ||
'0'}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_browser_loader_tests:
name: PW ${{ matrix.bundle }} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
bundle:
- loader_base
- loader_eager
- loader_debug
- loader_tracing
- loader_replay
- loader_replay_buffer
- loader_tracing_replay
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
- name: Run Playwright Loader tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
run: |
cd dev-packages/browser-integration-tests
yarn test:loader
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_browser_loader_tests-${{ matrix.bundle}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_check_for_faulty_dts:
name: Check for faulty .d.ts files
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Check for dts files that reference stuff in the temporary build folder
run: |
if grep -r --include "*.d.ts" --exclude-dir ".nx" 'import("@sentry(-internal)?/[^/]*/build' .; then
echo "Found illegal TypeScript import statement."
exit 1
fi
job_node_integration_tests:
name:
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }}${{
(matrix.use_orchestrion && format(' (Orchestrion)', matrix.use_orchestrion)) || '' }} Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_node_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
typescript:
- false
use_orchestrion:
- false
include:
# Only check typescript for latest version (to streamline CI)
- node: 24
typescript: '5.0'
- node: 20.19
use_orchestrion: 'true'
- node: 22
use_orchestrion: 'true'
- node: 24
use_orchestrion: 'true'
- node: 26
use_orchestrion: 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Free up disk space if low
# The full suite pulls several DB docker images (mssql alone is ~1.5GB)
# Available disk space is not consistent, if we detect low space this cleans up some unused toolchains
run: |
df -h /
avail_kb=$(df -k --output=avail / | tail -1)
if [ "$avail_kb" -lt $((40 * 1024 * 1024)) ]; then
echo "Low disk space (<40GB free) — reclaiming unused toolchains"
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
df -h /
else
echo "Sufficient disk space — skipping cleanup"
fi
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Overwrite typescript version
if: matrix.typescript == '5.0'
run: node ./scripts/use-ts-5_0.js
working-directory: dev-packages/node-integration-tests
- name: Run integration tests
working-directory: dev-packages/node-integration-tests
run: yarn test
env:
INJECT_ORCHESTRION: ${{ matrix.use_orchestrion }}
job_cloudflare_integration_tests:
name: Cloudflare Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_cloudflare_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/cloudflare-integration-tests
run: yarn test
job_bundler_plugin_integration_tests:
name: Bundler Plugin Integration Tests (Node ${{ matrix.node }})
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bundler_plugin_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
# The fixtures install the locally-packed `@sentry/bundler-plugins` tarball with pnpm.
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bundler-plugin-integration-tests
run: yarn test
job_bun_integration_tests:
name: Bun Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bun-integration-tests
run: yarn test
job_deno_integration_tests:
name: Deno Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: 'v2.8.0'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build @sentry/deno
working-directory: packages/deno
run: yarn build
- name: Run integration tests
working-directory: dev-packages/deno-integration-tests
run: yarn test
job_build_tarballs:
name: Build tarballs
# We want to run this if:
# - The build job was successful, not skipped
if: |
always() &&
needs.job_build.result == 'success'
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build tarballs
run: yarn build:tarball
- name: Upload tarball artifacts
uses: actions/upload-artifact@v7
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_GLOB }}
if-no-files-found: error
retention-days: 4
compression-level: 6
overwrite: true
job_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_build_tarballs.result == 'success' && needs.job_build.outputs.e2e-matrix !='{"include":[]}'
needs: [job_get_metadata, job_build, job_build_layer, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
# We just use a dummy DSN here, only send to the tunnel anyhow
E2E_TEST_DSN: 'https://username@domain/123'
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
REACT_APP_E2E_TEST_DSN: 'https://username@domain/123'
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Bun
if:
contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "hono-4", "bun-bytecode",
"bun-mysql"]'), matrix.test-application)
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Set up AWS SAM
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Deno
if:
matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed' || matrix.test-application ==
'deno-redis'|| matrix.test-application == 'hono-4' || matrix.test-application == 'deno-mysql' ||
matrix.test-application == 'deno-pg'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Prepare e2e tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate e2e tests setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
path: ${{ runner.temp }}/test-application/test-results
overwrite: true
retention-days: 7
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
# - We skip optional tests on release branches
job_optional_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test (optional)
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_get_metadata.outputs.is_release != 'true' && needs.job_build_tarballs.result == 'success' &&
needs.job_build.outputs.e2e-matrix-optional != '{"include":[]}' && (github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
needs: [job_get_metadata, job_build, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
REACT_APP_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix-optional) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Deno
if: matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Prepare E2E tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate test setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
job_required_jobs_passed:
name: All required jobs passed or were skipped
needs:
[
job_build,
job_build_bundles,
job_build_layer,
job_build_tarballs,
job_browser_unit_tests,
job_bun_unit_tests,
job_deno_unit_tests,
job_node_unit_tests,
job_node_integration_tests,
job_cloudflare_integration_tests,
job_bundler_plugin_integration_tests,
job_bun_integration_tests,
job_deno_integration_tests,
job_browser_playwright_tests,
job_browser_loader_tests,
job_e2e_tests,
job_artifacts,
job_lint,
job_check_lockfile,
job_check_format,
job_circular_dep_check,
job_size_check,
]
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-24.04
permissions:
issues: write
checks: read
steps:
- name: Check out current commit
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
scripts
- name: Create issues for failed jobs
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/github-script@v9
with:
script: |
const { default: run } = await import(
`${process.env.GITHUB_WORKSPACE}/scripts/report-ci-failures.mjs`
);
await run({ github, context, core });
- name: Check for failures
if: cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
fix(core): Use wall clock for structured log timestamps · getsentry/sentry-javascript@3aea457 · GitHub
Skip to content

fix(core): Use wall clock for structured log timestamps #52683

fix(core): Use wall clock for structured log timestamps

fix(core): Use wall clock for structured log timestamps #52683

Workflow file for this run

name: 'CI: Build & Test'
on:
push:
branches:
- develop
- master
- v10
- v9
- v8
- release/**
pull_request:
merge_group:
types: [checks_requested]
workflow_dispatch:
inputs:
commit:
description: If the commit you want to test isn't the head of a branch, provide its SHA here
required: false
schedule:
# Run every day at midnight (without cache)
- cron: '0 0 * * *'
# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
CACHED_DEPENDENCY_PATHS: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/packages/*/node_modules
${{ github.workspace }}/dev-packages/*/node_modules
~/.cache/mongodb-binaries/
# DEPENDENCY_CACHE_KEY: can't be set here because we don't have access to yarn.lock
# build-output artifact paths are computed in job_build (step output from
# yarn ci:print-build-artifact-paths — Nx merged outputs for build:transpile, and build:types).
# upload-artifact globs drop the path through the first `*` (see upload-artifact
# README). Tarballs therefore land in the artifact as <pkg>/*.tgz; download
# build-tarball-output into packages/ so they resolve to packages/<pkg>/*.tgz.
TARBALL_ARTIFACT_GLOB: packages/*/*.tgz
TARBALL_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
BUILD_LAYER_PATH: ${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless
# Same glob / download split as TARBALL_ARTIFACT_*: upload-artifact strips the path through
# the first `*`, so bundle trees are stored as <pkg>/build/bundles/...; download into packages/.
BUNDLE_ARTIFACT_GLOB: packages/*/build/bundles
BUNDLE_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
NX_CACHE_KEY: nx-Linux-${{ github.head_ref || github.ref }}-${{ github.run_id }}
# https://bsky.app/profile/joyeecheung.bsky.social/post/3lhy6o54fo22h
# Apparently some of our CI failures are attributable to a corrupt v8 cache, causing v8 failures with: "Check failed: current == end_slot_index.".
# This option both controls the `v8-compile-cache-lib` and `v8-compile-cache` packages.
DISABLE_V8_COMPILE_CACHE: '1'
jobs:
job_get_metadata:
uses: ./.github/workflows/ci-metadata.yml
name: Get CI Metadata
with:
head_commit: ${{ github.event.inputs.commit || github.sha }}
permissions:
pull-requests: read
job_build:
name: Build
needs: job_get_metadata
runs-on: ubuntu-24.04
timeout-minutes: 15
if: |
needs.job_get_metadata.outputs.changed_any_code == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true' ||
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false' && needs.job_get_metadata.outputs.changed_any_code == 'true')
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check for Affected Nx Projects
uses: ./.github/actions/nx-affected-list
id: checkForAffected
if: github.event_name == 'pull_request'
with:
base: ${{ github.event.pull_request.base.sha }}
head: ${{ env.HEAD_COMMIT }}
- name: Build packages
run: yarn build:ci
- name: Compute build artifact paths from Nx
id: nx_build_paths
run: |
{
echo 'paths<<EOF'
yarn --silent ci:print-build-artifact-paths
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Store NX cache
uses: actions/cache/save@v5
# Only cache this per-PR to speed up CI.
if: github.event_name == 'pull_request'
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-output
path: ${{ steps.nx_build_paths.outputs.paths }}
retention-days: 4
compression-level: 6
overwrite: true
- name: Determine which test applications should be run
id: matrix
run:
yarn --silent ci:build-matrix --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
- name: Determine which optional E2E test applications should be run
id: matrix-optional
run:
yarn --silent ci:build-matrix-optional --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
outputs:
dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }}
changed_node_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/node-integration-tests') }}
changed_node:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/node') }}
changed_deno:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/deno') }}
changed_bun:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/bun') }}
changed_bun_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bun-integration-tests') }}
changed_deno_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/deno-integration-tests') }}
changed_browser_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/browser-integration-tests') }}
changed_cloudflare_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/cloudflare-integration-tests') }}
changed_bundler_plugin_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bundler-plugin-integration-tests') }}
changed_aws_serverless:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/aws-serverless') }}
e2e-matrix: ${{ steps.matrix.outputs.matrix }}
e2e-matrix-optional: ${{ steps.matrix-optional.outputs.matrix }}
job_build_layer:
name: Build Lambda layer
needs: [job_get_metadata, job_build]
if:
needs.job_build.outputs.changed_aws_serverless == 'true' || contains(needs.job_build.outputs.e2e-matrix,
'aws-serverless') || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build Lambda layer
run: yarn build:layer
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
retention-days: 4
compression-level: 6
overwrite: true
job_build_bundles:
name: Build bundles
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build bundles
run: yarn build:bundle
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_GLOB }}
retention-days: 4
compression-level: 6
overwrite: true
job_check_branches:
name: Check PR branches
needs: job_get_metadata
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: PR is opened against master
uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0
if: ${{ github.base_ref == 'master' && !startsWith(github.head_ref, 'prepare-release/') }}
with:
message: |
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
job_size_check:
name: Size Check
needs: [job_get_metadata, job_build, job_build_bundles]
timeout-minutes: 15
runs-on: ubuntu-24.04
if:
github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Check bundle sizes
uses: ./dev-packages/size-limit-gh-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Only run comparison against develop if this is a PR
comparison_branch: ${{ (github.event_name == 'pull_request' && github.base_ref) || ''}}
job_lint:
name: Lint
# Even though the linter only checks source code, not built code, it needs the built code in order check that all
# inter-package dependencies resolve cleanly.
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Lint source files
run: yarn lint
- name: Lint for ES compatibility
run: yarn lint:es-compatibility
- name: Lint types
run: yarn lint:types
job_check_lockfile:
name: Check lockfile
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
if: |
needs.job_get_metadata.outputs.changed_deps == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install dependencies
run: yarn install --ignore-engines
- name: Check that yarn.lock is stable
run: |
if ! git diff --exit-code yarn.lock; then
echo "::error::yarn.lock has uncommitted changes after running 'yarn install'. Please run 'yarn install' locally and commit the updated yarn.lock."
exit 1
fi
- name: Check for duplicate dependencies in lockfile
run: yarn dedupe-deps:check
job_check_format:
name: Check file formatting
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check file formatting
run: yarn format:check
job_circular_dep_check:
name: Circular Dependency Check
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run madge
run: yarn circularDepCheck
job_artifacts:
name: Upload Artifacts
needs: [job_get_metadata, job_build, job_build_layer, job_build_bundles, job_build_tarballs]
runs-on: ubuntu-24.04
# Build artifacts are only needed for releasing workflow.
if: needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Archive artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}
retention-days: 90
path: |
${{ github.workspace }}/packages/browser/build/bundles/**
${{ github.workspace }}/packages/replay-internal/build/bundles/**
${{ github.workspace }}/packages/replay-canvas/build/bundles/**
${{ github.workspace }}/packages/feedback/build/bundles/**
${{ github.workspace }}/packages/**/*.tgz
${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless/*.zip
job_browser_unit_tests:
name: Browser Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:browser --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
- name: Run all tests
run: yarn test:ci:browser
if: github.event_name != 'pull_request'
job_bun_unit_tests:
name: Bun Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
yarn test:ci:bun
job_deno_unit_tests:
name: Deno Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
cd packages/deno
yarn build
yarn test
job_node_unit_tests:
name: Node (${{ matrix.node }}) Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:node --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
- name: Run all tests
run: yarn test:ci:node
if: github.event_name != 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
job_browser_playwright_tests:
name:
Playwright ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}',
matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04-large-js
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
bundle:
- esm
- bundle
- bundle_min
- bundle_logs_metrics
- bundle_replay
- bundle_replay_logs_metrics
- bundle_tracing
- bundle_tracing_logs_metrics
- bundle_tracing_replay
- bundle_tracing_replay_logs_metrics
- bundle_tracing_replay_feedback
- bundle_tracing_replay_feedback_logs_metrics
- bundle_tracing_replay_feedback_logs_metrics_min
project:
- chromium
include:
# Only check all projects for full bundle
# We also shard the tests as they take the longest
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'webkit'
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'firefox'
- bundle: esm
project: chromium
shard: 1
shards: 4
- bundle: esm
project: chromium
shard: 2
shards: 4
- bundle: esm
project: chromium
shard: 3
shards: 4
- bundle: esm
project: chromium
shard: 4
shards: 4
exclude:
# Do not run the un-sharded esm tests
- bundle: esm
project: 'chromium'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: ${{ matrix.project }}
- name: Run Playwright tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
working-directory: dev-packages/browser-integration-tests
run:
yarn test:all${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard &&
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name:
playwright-traces-job_browser_playwright_tests-${{ matrix.bundle}}-${{matrix.project}}-${{matrix.shard ||
'0'}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_browser_loader_tests:
name: PW ${{ matrix.bundle }} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
bundle:
- loader_base
- loader_eager
- loader_debug
- loader_tracing
- loader_replay
- loader_replay_buffer
- loader_tracing_replay
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
- name: Run Playwright Loader tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
run: |
cd dev-packages/browser-integration-tests
yarn test:loader
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_browser_loader_tests-${{ matrix.bundle}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_check_for_faulty_dts:
name: Check for faulty .d.ts files
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Check for dts files that reference stuff in the temporary build folder
run: |
if grep -r --include "*.d.ts" --exclude-dir ".nx" 'import("@sentry(-internal)?/[^/]*/build' .; then
echo "Found illegal TypeScript import statement."
exit 1
fi
job_node_integration_tests:
name:
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }}${{
(matrix.use_orchestrion && format(' (Orchestrion)', matrix.use_orchestrion)) || '' }} Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_node_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
typescript:
- false
use_orchestrion:
- false
include:
# Only check typescript for latest version (to streamline CI)
- node: 24
typescript: '5.0'
- node: 20.19
use_orchestrion: 'true'
- node: 22
use_orchestrion: 'true'
- node: 24
use_orchestrion: 'true'
- node: 26
use_orchestrion: 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Free up disk space if low
# The full suite pulls several DB docker images (mssql alone is ~1.5GB)
# Available disk space is not consistent, if we detect low space this cleans up some unused toolchains
run: |
df -h /
avail_kb=$(df -k --output=avail / | tail -1)
if [ "$avail_kb" -lt $((40 * 1024 * 1024)) ]; then
echo "Low disk space (<40GB free) — reclaiming unused toolchains"
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
df -h /
else
echo "Sufficient disk space — skipping cleanup"
fi
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Overwrite typescript version
if: matrix.typescript == '5.0'
run: node ./scripts/use-ts-5_0.js
working-directory: dev-packages/node-integration-tests
- name: Run integration tests
working-directory: dev-packages/node-integration-tests
run: yarn test
env:
INJECT_ORCHESTRION: ${{ matrix.use_orchestrion }}
job_cloudflare_integration_tests:
name: Cloudflare Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_cloudflare_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/cloudflare-integration-tests
run: yarn test
job_bundler_plugin_integration_tests:
name: Bundler Plugin Integration Tests (Node ${{ matrix.node }})
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bundler_plugin_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
# The fixtures install the locally-packed `@sentry/bundler-plugins` tarball with pnpm.
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bundler-plugin-integration-tests
run: yarn test
job_bun_integration_tests:
name: Bun Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bun-integration-tests
run: yarn test
job_deno_integration_tests:
name: Deno Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: 'v2.8.0'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build @sentry/deno
working-directory: packages/deno
run: yarn build
- name: Run integration tests
working-directory: dev-packages/deno-integration-tests
run: yarn test
job_build_tarballs:
name: Build tarballs
# We want to run this if:
# - The build job was successful, not skipped
if: |
always() &&
needs.job_build.result == 'success'
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build tarballs
run: yarn build:tarball
- name: Upload tarball artifacts
uses: actions/upload-artifact@v7
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_GLOB }}
if-no-files-found: error
retention-days: 4
compression-level: 6
overwrite: true
job_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_build_tarballs.result == 'success' && needs.job_build.outputs.e2e-matrix !='{"include":[]}'
needs: [job_get_metadata, job_build, job_build_layer, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
# We just use a dummy DSN here, only send to the tunnel anyhow
E2E_TEST_DSN: 'https://username@domain/123'
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
REACT_APP_E2E_TEST_DSN: 'https://username@domain/123'
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Bun
if:
contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "hono-4", "bun-bytecode",
"bun-mysql"]'), matrix.test-application)
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Set up AWS SAM
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Deno
if:
matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed' || matrix.test-application ==
'deno-redis'|| matrix.test-application == 'hono-4' || matrix.test-application == 'deno-mysql' ||
matrix.test-application == 'deno-pg'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Prepare e2e tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate e2e tests setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
path: ${{ runner.temp }}/test-application/test-results
overwrite: true
retention-days: 7
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
# - We skip optional tests on release branches
job_optional_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test (optional)
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_get_metadata.outputs.is_release != 'true' && needs.job_build_tarballs.result == 'success' &&
needs.job_build.outputs.e2e-matrix-optional != '{"include":[]}' && (github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
needs: [job_get_metadata, job_build, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
REACT_APP_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix-optional) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Deno
if: matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Prepare E2E tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate test setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
job_required_jobs_passed:
name: All required jobs passed or were skipped
needs:
[
job_build,
job_build_bundles,
job_build_layer,
job_build_tarballs,
job_browser_unit_tests,
job_bun_unit_tests,
job_deno_unit_tests,
job_node_unit_tests,
job_node_integration_tests,
job_cloudflare_integration_tests,
job_bundler_plugin_integration_tests,
job_bun_integration_tests,
job_deno_integration_tests,
job_browser_playwright_tests,
job_browser_loader_tests,
job_e2e_tests,
job_artifacts,
job_lint,
job_check_lockfile,
job_check_format,
job_circular_dep_check,
job_size_check,
]
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-24.04
permissions:
issues: write
checks: read
steps:
- name: Check out current commit
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
scripts
- name: Create issues for failed jobs
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/github-script@v9
with:
script: |
const { default: run } = await import(
`${process.env.GITHUB_WORKSPACE}/scripts/report-ci-failures.mjs`
);
await run({ github, context, core });
- name: Check for failures
if: cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(core): Use wall clock for structured log timestamps · getsentry/sentry-javascript@3aea457 · GitHub
Skip to content

fix(core): Use wall clock for structured log timestamps #52683

fix(core): Use wall clock for structured log timestamps

fix(core): Use wall clock for structured log timestamps #52683

Workflow file for this run

name: 'CI: Build & Test'
on:
push:
branches:
- develop
- master
- v10
- v9
- v8
- release/**
pull_request:
merge_group:
types: [checks_requested]
workflow_dispatch:
inputs:
commit:
description: If the commit you want to test isn't the head of a branch, provide its SHA here
required: false
schedule:
# Run every day at midnight (without cache)
- cron: '0 0 * * *'
# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
CACHED_DEPENDENCY_PATHS: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/packages/*/node_modules
${{ github.workspace }}/dev-packages/*/node_modules
~/.cache/mongodb-binaries/
# DEPENDENCY_CACHE_KEY: can't be set here because we don't have access to yarn.lock
# build-output artifact paths are computed in job_build (step output from
# yarn ci:print-build-artifact-paths — Nx merged outputs for build:transpile, and build:types).
# upload-artifact globs drop the path through the first `*` (see upload-artifact
# README). Tarballs therefore land in the artifact as <pkg>/*.tgz; download
# build-tarball-output into packages/ so they resolve to packages/<pkg>/*.tgz.
TARBALL_ARTIFACT_GLOB: packages/*/*.tgz
TARBALL_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
BUILD_LAYER_PATH: ${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless
# Same glob / download split as TARBALL_ARTIFACT_*: upload-artifact strips the path through
# the first `*`, so bundle trees are stored as <pkg>/build/bundles/...; download into packages/.
BUNDLE_ARTIFACT_GLOB: packages/*/build/bundles
BUNDLE_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
NX_CACHE_KEY: nx-Linux-${{ github.head_ref || github.ref }}-${{ github.run_id }}
# https://bsky.app/profile/joyeecheung.bsky.social/post/3lhy6o54fo22h
# Apparently some of our CI failures are attributable to a corrupt v8 cache, causing v8 failures with: "Check failed: current == end_slot_index.".
# This option both controls the `v8-compile-cache-lib` and `v8-compile-cache` packages.
DISABLE_V8_COMPILE_CACHE: '1'
jobs:
job_get_metadata:
uses: ./.github/workflows/ci-metadata.yml
name: Get CI Metadata
with:
head_commit: ${{ github.event.inputs.commit || github.sha }}
permissions:
pull-requests: read
job_build:
name: Build
needs: job_get_metadata
runs-on: ubuntu-24.04
timeout-minutes: 15
if: |
needs.job_get_metadata.outputs.changed_any_code == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true' ||
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false' && needs.job_get_metadata.outputs.changed_any_code == 'true')
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check for Affected Nx Projects
uses: ./.github/actions/nx-affected-list
id: checkForAffected
if: github.event_name == 'pull_request'
with:
base: ${{ github.event.pull_request.base.sha }}
head: ${{ env.HEAD_COMMIT }}
- name: Build packages
run: yarn build:ci
- name: Compute build artifact paths from Nx
id: nx_build_paths
run: |
{
echo 'paths<<EOF'
yarn --silent ci:print-build-artifact-paths
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Store NX cache
uses: actions/cache/save@v5
# Only cache this per-PR to speed up CI.
if: github.event_name == 'pull_request'
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-output
path: ${{ steps.nx_build_paths.outputs.paths }}
retention-days: 4
compression-level: 6
overwrite: true
- name: Determine which test applications should be run
id: matrix
run:
yarn --silent ci:build-matrix --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
- name: Determine which optional E2E test applications should be run
id: matrix-optional
run:
yarn --silent ci:build-matrix-optional --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
outputs:
dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }}
changed_node_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/node-integration-tests') }}
changed_node:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/node') }}
changed_deno:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/deno') }}
changed_bun:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/bun') }}
changed_bun_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bun-integration-tests') }}
changed_deno_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/deno-integration-tests') }}
changed_browser_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/browser-integration-tests') }}
changed_cloudflare_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/cloudflare-integration-tests') }}
changed_bundler_plugin_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bundler-plugin-integration-tests') }}
changed_aws_serverless:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/aws-serverless') }}
e2e-matrix: ${{ steps.matrix.outputs.matrix }}
e2e-matrix-optional: ${{ steps.matrix-optional.outputs.matrix }}
job_build_layer:
name: Build Lambda layer
needs: [job_get_metadata, job_build]
if:
needs.job_build.outputs.changed_aws_serverless == 'true' || contains(needs.job_build.outputs.e2e-matrix,
'aws-serverless') || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build Lambda layer
run: yarn build:layer
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
retention-days: 4
compression-level: 6
overwrite: true
job_build_bundles:
name: Build bundles
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build bundles
run: yarn build:bundle
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_GLOB }}
retention-days: 4
compression-level: 6
overwrite: true
job_check_branches:
name: Check PR branches
needs: job_get_metadata
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: PR is opened against master
uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0
if: ${{ github.base_ref == 'master' && !startsWith(github.head_ref, 'prepare-release/') }}
with:
message: |
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
job_size_check:
name: Size Check
needs: [job_get_metadata, job_build, job_build_bundles]
timeout-minutes: 15
runs-on: ubuntu-24.04
if:
github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Check bundle sizes
uses: ./dev-packages/size-limit-gh-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Only run comparison against develop if this is a PR
comparison_branch: ${{ (github.event_name == 'pull_request' && github.base_ref) || ''}}
job_lint:
name: Lint
# Even though the linter only checks source code, not built code, it needs the built code in order check that all
# inter-package dependencies resolve cleanly.
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Lint source files
run: yarn lint
- name: Lint for ES compatibility
run: yarn lint:es-compatibility
- name: Lint types
run: yarn lint:types
job_check_lockfile:
name: Check lockfile
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
if: |
needs.job_get_metadata.outputs.changed_deps == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install dependencies
run: yarn install --ignore-engines
- name: Check that yarn.lock is stable
run: |
if ! git diff --exit-code yarn.lock; then
echo "::error::yarn.lock has uncommitted changes after running 'yarn install'. Please run 'yarn install' locally and commit the updated yarn.lock."
exit 1
fi
- name: Check for duplicate dependencies in lockfile
run: yarn dedupe-deps:check
job_check_format:
name: Check file formatting
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check file formatting
run: yarn format:check
job_circular_dep_check:
name: Circular Dependency Check
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run madge
run: yarn circularDepCheck
job_artifacts:
name: Upload Artifacts
needs: [job_get_metadata, job_build, job_build_layer, job_build_bundles, job_build_tarballs]
runs-on: ubuntu-24.04
# Build artifacts are only needed for releasing workflow.
if: needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Archive artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}
retention-days: 90
path: |
${{ github.workspace }}/packages/browser/build/bundles/**
${{ github.workspace }}/packages/replay-internal/build/bundles/**
${{ github.workspace }}/packages/replay-canvas/build/bundles/**
${{ github.workspace }}/packages/feedback/build/bundles/**
${{ github.workspace }}/packages/**/*.tgz
${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless/*.zip
job_browser_unit_tests:
name: Browser Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:browser --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
- name: Run all tests
run: yarn test:ci:browser
if: github.event_name != 'pull_request'
job_bun_unit_tests:
name: Bun Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
yarn test:ci:bun
job_deno_unit_tests:
name: Deno Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
cd packages/deno
yarn build
yarn test
job_node_unit_tests:
name: Node (${{ matrix.node }}) Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:node --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
- name: Run all tests
run: yarn test:ci:node
if: github.event_name != 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
job_browser_playwright_tests:
name:
Playwright ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}',
matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04-large-js
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
bundle:
- esm
- bundle
- bundle_min
- bundle_logs_metrics
- bundle_replay
- bundle_replay_logs_metrics
- bundle_tracing
- bundle_tracing_logs_metrics
- bundle_tracing_replay
- bundle_tracing_replay_logs_metrics
- bundle_tracing_replay_feedback
- bundle_tracing_replay_feedback_logs_metrics
- bundle_tracing_replay_feedback_logs_metrics_min
project:
- chromium
include:
# Only check all projects for full bundle
# We also shard the tests as they take the longest
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'webkit'
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'firefox'
- bundle: esm
project: chromium
shard: 1
shards: 4
- bundle: esm
project: chromium
shard: 2
shards: 4
- bundle: esm
project: chromium
shard: 3
shards: 4
- bundle: esm
project: chromium
shard: 4
shards: 4
exclude:
# Do not run the un-sharded esm tests
- bundle: esm
project: 'chromium'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: ${{ matrix.project }}
- name: Run Playwright tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
working-directory: dev-packages/browser-integration-tests
run:
yarn test:all${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard &&
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name:
playwright-traces-job_browser_playwright_tests-${{ matrix.bundle}}-${{matrix.project}}-${{matrix.shard ||
'0'}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_browser_loader_tests:
name: PW ${{ matrix.bundle }} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
bundle:
- loader_base
- loader_eager
- loader_debug
- loader_tracing
- loader_replay
- loader_replay_buffer
- loader_tracing_replay
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
- name: Run Playwright Loader tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
run: |
cd dev-packages/browser-integration-tests
yarn test:loader
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_browser_loader_tests-${{ matrix.bundle}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_check_for_faulty_dts:
name: Check for faulty .d.ts files
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Check for dts files that reference stuff in the temporary build folder
run: |
if grep -r --include "*.d.ts" --exclude-dir ".nx" 'import("@sentry(-internal)?/[^/]*/build' .; then
echo "Found illegal TypeScript import statement."
exit 1
fi
job_node_integration_tests:
name:
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }}${{
(matrix.use_orchestrion && format(' (Orchestrion)', matrix.use_orchestrion)) || '' }} Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_node_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
typescript:
- false
use_orchestrion:
- false
include:
# Only check typescript for latest version (to streamline CI)
- node: 24
typescript: '5.0'
- node: 20.19
use_orchestrion: 'true'
- node: 22
use_orchestrion: 'true'
- node: 24
use_orchestrion: 'true'
- node: 26
use_orchestrion: 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Free up disk space if low
# The full suite pulls several DB docker images (mssql alone is ~1.5GB)
# Available disk space is not consistent, if we detect low space this cleans up some unused toolchains
run: |
df -h /
avail_kb=$(df -k --output=avail / | tail -1)
if [ "$avail_kb" -lt $((40 * 1024 * 1024)) ]; then
echo "Low disk space (<40GB free) — reclaiming unused toolchains"
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
df -h /
else
echo "Sufficient disk space — skipping cleanup"
fi
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Overwrite typescript version
if: matrix.typescript == '5.0'
run: node ./scripts/use-ts-5_0.js
working-directory: dev-packages/node-integration-tests
- name: Run integration tests
working-directory: dev-packages/node-integration-tests
run: yarn test
env:
INJECT_ORCHESTRION: ${{ matrix.use_orchestrion }}
job_cloudflare_integration_tests:
name: Cloudflare Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_cloudflare_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/cloudflare-integration-tests
run: yarn test
job_bundler_plugin_integration_tests:
name: Bundler Plugin Integration Tests (Node ${{ matrix.node }})
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bundler_plugin_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
# The fixtures install the locally-packed `@sentry/bundler-plugins` tarball with pnpm.
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bundler-plugin-integration-tests
run: yarn test
job_bun_integration_tests:
name: Bun Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bun-integration-tests
run: yarn test
job_deno_integration_tests:
name: Deno Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: 'v2.8.0'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build @sentry/deno
working-directory: packages/deno
run: yarn build
- name: Run integration tests
working-directory: dev-packages/deno-integration-tests
run: yarn test
job_build_tarballs:
name: Build tarballs
# We want to run this if:
# - The build job was successful, not skipped
if: |
always() &&
needs.job_build.result == 'success'
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build tarballs
run: yarn build:tarball
- name: Upload tarball artifacts
uses: actions/upload-artifact@v7
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_GLOB }}
if-no-files-found: error
retention-days: 4
compression-level: 6
overwrite: true
job_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_build_tarballs.result == 'success' && needs.job_build.outputs.e2e-matrix !='{"include":[]}'
needs: [job_get_metadata, job_build, job_build_layer, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
# We just use a dummy DSN here, only send to the tunnel anyhow
E2E_TEST_DSN: 'https://username@domain/123'
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
REACT_APP_E2E_TEST_DSN: 'https://username@domain/123'
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Bun
if:
contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "hono-4", "bun-bytecode",
"bun-mysql"]'), matrix.test-application)
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Set up AWS SAM
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Deno
if:
matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed' || matrix.test-application ==
'deno-redis'|| matrix.test-application == 'hono-4' || matrix.test-application == 'deno-mysql' ||
matrix.test-application == 'deno-pg'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Prepare e2e tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate e2e tests setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
path: ${{ runner.temp }}/test-application/test-results
overwrite: true
retention-days: 7
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
# - We skip optional tests on release branches
job_optional_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test (optional)
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_get_metadata.outputs.is_release != 'true' && needs.job_build_tarballs.result == 'success' &&
needs.job_build.outputs.e2e-matrix-optional != '{"include":[]}' && (github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
needs: [job_get_metadata, job_build, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
REACT_APP_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix-optional) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Deno
if: matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Prepare E2E tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate test setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
job_required_jobs_passed:
name: All required jobs passed or were skipped
needs:
[
job_build,
job_build_bundles,
job_build_layer,
job_build_tarballs,
job_browser_unit_tests,
job_bun_unit_tests,
job_deno_unit_tests,
job_node_unit_tests,
job_node_integration_tests,
job_cloudflare_integration_tests,
job_bundler_plugin_integration_tests,
job_bun_integration_tests,
job_deno_integration_tests,
job_browser_playwright_tests,
job_browser_loader_tests,
job_e2e_tests,
job_artifacts,
job_lint,
job_check_lockfile,
job_check_format,
job_circular_dep_check,
job_size_check,
]
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-24.04
permissions:
issues: write
checks: read
steps:
- name: Check out current commit
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
scripts
- name: Create issues for failed jobs
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/github-script@v9
with:
script: |
const { default: run } = await import(
`${process.env.GITHUB_WORKSPACE}/scripts/report-ci-failures.mjs`
);
await run({ github, context, core });
- name: Check for failures
if: cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(core): Use wall clock for structured log timestamps · getsentry/sentry-javascript@3aea457 · GitHub
Skip to content

fix(core): Use wall clock for structured log timestamps #52683

fix(core): Use wall clock for structured log timestamps

fix(core): Use wall clock for structured log timestamps #52683

Workflow file for this run

name: 'CI: Build & Test'
on:
push:
branches:
- develop
- master
- v10
- v9
- v8
- release/**
pull_request:
merge_group:
types: [checks_requested]
workflow_dispatch:
inputs:
commit:
description: If the commit you want to test isn't the head of a branch, provide its SHA here
required: false
schedule:
# Run every day at midnight (without cache)
- cron: '0 0 * * *'
# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
CACHED_DEPENDENCY_PATHS: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/packages/*/node_modules
${{ github.workspace }}/dev-packages/*/node_modules
~/.cache/mongodb-binaries/
# DEPENDENCY_CACHE_KEY: can't be set here because we don't have access to yarn.lock
# build-output artifact paths are computed in job_build (step output from
# yarn ci:print-build-artifact-paths — Nx merged outputs for build:transpile, and build:types).
# upload-artifact globs drop the path through the first `*` (see upload-artifact
# README). Tarballs therefore land in the artifact as <pkg>/*.tgz; download
# build-tarball-output into packages/ so they resolve to packages/<pkg>/*.tgz.
TARBALL_ARTIFACT_GLOB: packages/*/*.tgz
TARBALL_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
BUILD_LAYER_PATH: ${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless
# Same glob / download split as TARBALL_ARTIFACT_*: upload-artifact strips the path through
# the first `*`, so bundle trees are stored as <pkg>/build/bundles/...; download into packages/.
BUNDLE_ARTIFACT_GLOB: packages/*/build/bundles
BUNDLE_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
NX_CACHE_KEY: nx-Linux-${{ github.head_ref || github.ref }}-${{ github.run_id }}
# https://bsky.app/profile/joyeecheung.bsky.social/post/3lhy6o54fo22h
# Apparently some of our CI failures are attributable to a corrupt v8 cache, causing v8 failures with: "Check failed: current == end_slot_index.".
# This option both controls the `v8-compile-cache-lib` and `v8-compile-cache` packages.
DISABLE_V8_COMPILE_CACHE: '1'
jobs:
job_get_metadata:
uses: ./.github/workflows/ci-metadata.yml
name: Get CI Metadata
with:
head_commit: ${{ github.event.inputs.commit || github.sha }}
permissions:
pull-requests: read
job_build:
name: Build
needs: job_get_metadata
runs-on: ubuntu-24.04
timeout-minutes: 15
if: |
needs.job_get_metadata.outputs.changed_any_code == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true' ||
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false' && needs.job_get_metadata.outputs.changed_any_code == 'true')
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check for Affected Nx Projects
uses: ./.github/actions/nx-affected-list
id: checkForAffected
if: github.event_name == 'pull_request'
with:
base: ${{ github.event.pull_request.base.sha }}
head: ${{ env.HEAD_COMMIT }}
- name: Build packages
run: yarn build:ci
- name: Compute build artifact paths from Nx
id: nx_build_paths
run: |
{
echo 'paths<<EOF'
yarn --silent ci:print-build-artifact-paths
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Store NX cache
uses: actions/cache/save@v5
# Only cache this per-PR to speed up CI.
if: github.event_name == 'pull_request'
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-output
path: ${{ steps.nx_build_paths.outputs.paths }}
retention-days: 4
compression-level: 6
overwrite: true
- name: Determine which test applications should be run
id: matrix
run:
yarn --silent ci:build-matrix --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
- name: Determine which optional E2E test applications should be run
id: matrix-optional
run:
yarn --silent ci:build-matrix-optional --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
outputs:
dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }}
changed_node_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/node-integration-tests') }}
changed_node:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/node') }}
changed_deno:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/deno') }}
changed_bun:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/bun') }}
changed_bun_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bun-integration-tests') }}
changed_deno_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/deno-integration-tests') }}
changed_browser_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/browser-integration-tests') }}
changed_cloudflare_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/cloudflare-integration-tests') }}
changed_bundler_plugin_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bundler-plugin-integration-tests') }}
changed_aws_serverless:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/aws-serverless') }}
e2e-matrix: ${{ steps.matrix.outputs.matrix }}
e2e-matrix-optional: ${{ steps.matrix-optional.outputs.matrix }}
job_build_layer:
name: Build Lambda layer
needs: [job_get_metadata, job_build]
if:
needs.job_build.outputs.changed_aws_serverless == 'true' || contains(needs.job_build.outputs.e2e-matrix,
'aws-serverless') || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build Lambda layer
run: yarn build:layer
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
retention-days: 4
compression-level: 6
overwrite: true
job_build_bundles:
name: Build bundles
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build bundles
run: yarn build:bundle
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_GLOB }}
retention-days: 4
compression-level: 6
overwrite: true
job_check_branches:
name: Check PR branches
needs: job_get_metadata
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: PR is opened against master
uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0
if: ${{ github.base_ref == 'master' && !startsWith(github.head_ref, 'prepare-release/') }}
with:
message: |
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
job_size_check:
name: Size Check
needs: [job_get_metadata, job_build, job_build_bundles]
timeout-minutes: 15
runs-on: ubuntu-24.04
if:
github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Check bundle sizes
uses: ./dev-packages/size-limit-gh-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Only run comparison against develop if this is a PR
comparison_branch: ${{ (github.event_name == 'pull_request' && github.base_ref) || ''}}
job_lint:
name: Lint
# Even though the linter only checks source code, not built code, it needs the built code in order check that all
# inter-package dependencies resolve cleanly.
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Lint source files
run: yarn lint
- name: Lint for ES compatibility
run: yarn lint:es-compatibility
- name: Lint types
run: yarn lint:types
job_check_lockfile:
name: Check lockfile
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
if: |
needs.job_get_metadata.outputs.changed_deps == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install dependencies
run: yarn install --ignore-engines
- name: Check that yarn.lock is stable
run: |
if ! git diff --exit-code yarn.lock; then
echo "::error::yarn.lock has uncommitted changes after running 'yarn install'. Please run 'yarn install' locally and commit the updated yarn.lock."
exit 1
fi
- name: Check for duplicate dependencies in lockfile
run: yarn dedupe-deps:check
job_check_format:
name: Check file formatting
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check file formatting
run: yarn format:check
job_circular_dep_check:
name: Circular Dependency Check
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run madge
run: yarn circularDepCheck
job_artifacts:
name: Upload Artifacts
needs: [job_get_metadata, job_build, job_build_layer, job_build_bundles, job_build_tarballs]
runs-on: ubuntu-24.04
# Build artifacts are only needed for releasing workflow.
if: needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Archive artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}
retention-days: 90
path: |
${{ github.workspace }}/packages/browser/build/bundles/**
${{ github.workspace }}/packages/replay-internal/build/bundles/**
${{ github.workspace }}/packages/replay-canvas/build/bundles/**
${{ github.workspace }}/packages/feedback/build/bundles/**
${{ github.workspace }}/packages/**/*.tgz
${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless/*.zip
job_browser_unit_tests:
name: Browser Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:browser --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
- name: Run all tests
run: yarn test:ci:browser
if: github.event_name != 'pull_request'
job_bun_unit_tests:
name: Bun Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
yarn test:ci:bun
job_deno_unit_tests:
name: Deno Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
cd packages/deno
yarn build
yarn test
job_node_unit_tests:
name: Node (${{ matrix.node }}) Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:node --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
- name: Run all tests
run: yarn test:ci:node
if: github.event_name != 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
job_browser_playwright_tests:
name:
Playwright ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}',
matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04-large-js
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
bundle:
- esm
- bundle
- bundle_min
- bundle_logs_metrics
- bundle_replay
- bundle_replay_logs_metrics
- bundle_tracing
- bundle_tracing_logs_metrics
- bundle_tracing_replay
- bundle_tracing_replay_logs_metrics
- bundle_tracing_replay_feedback
- bundle_tracing_replay_feedback_logs_metrics
- bundle_tracing_replay_feedback_logs_metrics_min
project:
- chromium
include:
# Only check all projects for full bundle
# We also shard the tests as they take the longest
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'webkit'
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'firefox'
- bundle: esm
project: chromium
shard: 1
shards: 4
- bundle: esm
project: chromium
shard: 2
shards: 4
- bundle: esm
project: chromium
shard: 3
shards: 4
- bundle: esm
project: chromium
shard: 4
shards: 4
exclude:
# Do not run the un-sharded esm tests
- bundle: esm
project: 'chromium'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: ${{ matrix.project }}
- name: Run Playwright tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
working-directory: dev-packages/browser-integration-tests
run:
yarn test:all${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard &&
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name:
playwright-traces-job_browser_playwright_tests-${{ matrix.bundle}}-${{matrix.project}}-${{matrix.shard ||
'0'}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_browser_loader_tests:
name: PW ${{ matrix.bundle }} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
bundle:
- loader_base
- loader_eager
- loader_debug
- loader_tracing
- loader_replay
- loader_replay_buffer
- loader_tracing_replay
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
- name: Run Playwright Loader tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
run: |
cd dev-packages/browser-integration-tests
yarn test:loader
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_browser_loader_tests-${{ matrix.bundle}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_check_for_faulty_dts:
name: Check for faulty .d.ts files
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Check for dts files that reference stuff in the temporary build folder
run: |
if grep -r --include "*.d.ts" --exclude-dir ".nx" 'import("@sentry(-internal)?/[^/]*/build' .; then
echo "Found illegal TypeScript import statement."
exit 1
fi
job_node_integration_tests:
name:
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }}${{
(matrix.use_orchestrion && format(' (Orchestrion)', matrix.use_orchestrion)) || '' }} Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_node_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
typescript:
- false
use_orchestrion:
- false
include:
# Only check typescript for latest version (to streamline CI)
- node: 24
typescript: '5.0'
- node: 20.19
use_orchestrion: 'true'
- node: 22
use_orchestrion: 'true'
- node: 24
use_orchestrion: 'true'
- node: 26
use_orchestrion: 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Free up disk space if low
# The full suite pulls several DB docker images (mssql alone is ~1.5GB)
# Available disk space is not consistent, if we detect low space this cleans up some unused toolchains
run: |
df -h /
avail_kb=$(df -k --output=avail / | tail -1)
if [ "$avail_kb" -lt $((40 * 1024 * 1024)) ]; then
echo "Low disk space (<40GB free) — reclaiming unused toolchains"
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
df -h /
else
echo "Sufficient disk space — skipping cleanup"
fi
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Overwrite typescript version
if: matrix.typescript == '5.0'
run: node ./scripts/use-ts-5_0.js
working-directory: dev-packages/node-integration-tests
- name: Run integration tests
working-directory: dev-packages/node-integration-tests
run: yarn test
env:
INJECT_ORCHESTRION: ${{ matrix.use_orchestrion }}
job_cloudflare_integration_tests:
name: Cloudflare Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_cloudflare_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/cloudflare-integration-tests
run: yarn test
job_bundler_plugin_integration_tests:
name: Bundler Plugin Integration Tests (Node ${{ matrix.node }})
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bundler_plugin_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
# The fixtures install the locally-packed `@sentry/bundler-plugins` tarball with pnpm.
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bundler-plugin-integration-tests
run: yarn test
job_bun_integration_tests:
name: Bun Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bun-integration-tests
run: yarn test
job_deno_integration_tests:
name: Deno Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: 'v2.8.0'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build @sentry/deno
working-directory: packages/deno
run: yarn build
- name: Run integration tests
working-directory: dev-packages/deno-integration-tests
run: yarn test
job_build_tarballs:
name: Build tarballs
# We want to run this if:
# - The build job was successful, not skipped
if: |
always() &&
needs.job_build.result == 'success'
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build tarballs
run: yarn build:tarball
- name: Upload tarball artifacts
uses: actions/upload-artifact@v7
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_GLOB }}
if-no-files-found: error
retention-days: 4
compression-level: 6
overwrite: true
job_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_build_tarballs.result == 'success' && needs.job_build.outputs.e2e-matrix !='{"include":[]}'
needs: [job_get_metadata, job_build, job_build_layer, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
# We just use a dummy DSN here, only send to the tunnel anyhow
E2E_TEST_DSN: 'https://username@domain/123'
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
REACT_APP_E2E_TEST_DSN: 'https://username@domain/123'
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Bun
if:
contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "hono-4", "bun-bytecode",
"bun-mysql"]'), matrix.test-application)
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Set up AWS SAM
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Deno
if:
matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed' || matrix.test-application ==
'deno-redis'|| matrix.test-application == 'hono-4' || matrix.test-application == 'deno-mysql' ||
matrix.test-application == 'deno-pg'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Prepare e2e tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate e2e tests setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
path: ${{ runner.temp }}/test-application/test-results
overwrite: true
retention-days: 7
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
# - We skip optional tests on release branches
job_optional_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test (optional)
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_get_metadata.outputs.is_release != 'true' && needs.job_build_tarballs.result == 'success' &&
needs.job_build.outputs.e2e-matrix-optional != '{"include":[]}' && (github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
needs: [job_get_metadata, job_build, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
REACT_APP_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix-optional) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Deno
if: matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Prepare E2E tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate test setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
job_required_jobs_passed:
name: All required jobs passed or were skipped
needs:
[
job_build,
job_build_bundles,
job_build_layer,
job_build_tarballs,
job_browser_unit_tests,
job_bun_unit_tests,
job_deno_unit_tests,
job_node_unit_tests,
job_node_integration_tests,
job_cloudflare_integration_tests,
job_bundler_plugin_integration_tests,
job_bun_integration_tests,
job_deno_integration_tests,
job_browser_playwright_tests,
job_browser_loader_tests,
job_e2e_tests,
job_artifacts,
job_lint,
job_check_lockfile,
job_check_format,
job_circular_dep_check,
job_size_check,
]
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-24.04
permissions:
issues: write
checks: read
steps:
- name: Check out current commit
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
scripts
- name: Create issues for failed jobs
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/github-script@v9
with:
script: |
const { default: run } = await import(
`${process.env.GITHUB_WORKSPACE}/scripts/report-ci-failures.mjs`
);
await run({ github, context, core });
- name: Check for failures
if: cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' fix(core): Use wall clock for structured log timestamps · getsentry/sentry-javascript@3aea457 · GitHub
Skip to content

fix(core): Use wall clock for structured log timestamps #52683

fix(core): Use wall clock for structured log timestamps

fix(core): Use wall clock for structured log timestamps #52683

Workflow file for this run

name: 'CI: Build & Test'
on:
push:
branches:
- develop
- master
- v10
- v9
- v8
- release/**
pull_request:
merge_group:
types: [checks_requested]
workflow_dispatch:
inputs:
commit:
description: If the commit you want to test isn't the head of a branch, provide its SHA here
required: false
schedule:
# Run every day at midnight (without cache)
- cron: '0 0 * * *'
# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
CACHED_DEPENDENCY_PATHS: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/packages/*/node_modules
${{ github.workspace }}/dev-packages/*/node_modules
~/.cache/mongodb-binaries/
# DEPENDENCY_CACHE_KEY: can't be set here because we don't have access to yarn.lock
# build-output artifact paths are computed in job_build (step output from
# yarn ci:print-build-artifact-paths — Nx merged outputs for build:transpile, and build:types).
# upload-artifact globs drop the path through the first `*` (see upload-artifact
# README). Tarballs therefore land in the artifact as <pkg>/*.tgz; download
# build-tarball-output into packages/ so they resolve to packages/<pkg>/*.tgz.
TARBALL_ARTIFACT_GLOB: packages/*/*.tgz
TARBALL_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
BUILD_LAYER_PATH: ${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless
# Same glob / download split as TARBALL_ARTIFACT_*: upload-artifact strips the path through
# the first `*`, so bundle trees are stored as <pkg>/build/bundles/...; download into packages/.
BUNDLE_ARTIFACT_GLOB: packages/*/build/bundles
BUNDLE_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
NX_CACHE_KEY: nx-Linux-${{ github.head_ref || github.ref }}-${{ github.run_id }}
# https://bsky.app/profile/joyeecheung.bsky.social/post/3lhy6o54fo22h
# Apparently some of our CI failures are attributable to a corrupt v8 cache, causing v8 failures with: "Check failed: current == end_slot_index.".
# This option both controls the `v8-compile-cache-lib` and `v8-compile-cache` packages.
DISABLE_V8_COMPILE_CACHE: '1'
jobs:
job_get_metadata:
uses: ./.github/workflows/ci-metadata.yml
name: Get CI Metadata
with:
head_commit: ${{ github.event.inputs.commit || github.sha }}
permissions:
pull-requests: read
job_build:
name: Build
needs: job_get_metadata
runs-on: ubuntu-24.04
timeout-minutes: 15
if: |
needs.job_get_metadata.outputs.changed_any_code == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true' ||
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false' && needs.job_get_metadata.outputs.changed_any_code == 'true')
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check for Affected Nx Projects
uses: ./.github/actions/nx-affected-list
id: checkForAffected
if: github.event_name == 'pull_request'
with:
base: ${{ github.event.pull_request.base.sha }}
head: ${{ env.HEAD_COMMIT }}
- name: Build packages
run: yarn build:ci
- name: Compute build artifact paths from Nx
id: nx_build_paths
run: |
{
echo 'paths<<EOF'
yarn --silent ci:print-build-artifact-paths
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Store NX cache
uses: actions/cache/save@v5
# Only cache this per-PR to speed up CI.
if: github.event_name == 'pull_request'
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-output
path: ${{ steps.nx_build_paths.outputs.paths }}
retention-days: 4
compression-level: 6
overwrite: true
- name: Determine which test applications should be run
id: matrix
run:
yarn --silent ci:build-matrix --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
- name: Determine which optional E2E test applications should be run
id: matrix-optional
run:
yarn --silent ci:build-matrix-optional --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
outputs:
dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }}
changed_node_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/node-integration-tests') }}
changed_node:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/node') }}
changed_deno:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/deno') }}
changed_bun:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/bun') }}
changed_bun_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bun-integration-tests') }}
changed_deno_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/deno-integration-tests') }}
changed_browser_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/browser-integration-tests') }}
changed_cloudflare_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/cloudflare-integration-tests') }}
changed_bundler_plugin_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bundler-plugin-integration-tests') }}
changed_aws_serverless:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/aws-serverless') }}
e2e-matrix: ${{ steps.matrix.outputs.matrix }}
e2e-matrix-optional: ${{ steps.matrix-optional.outputs.matrix }}
job_build_layer:
name: Build Lambda layer
needs: [job_get_metadata, job_build]
if:
needs.job_build.outputs.changed_aws_serverless == 'true' || contains(needs.job_build.outputs.e2e-matrix,
'aws-serverless') || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build Lambda layer
run: yarn build:layer
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
retention-days: 4
compression-level: 6
overwrite: true
job_build_bundles:
name: Build bundles
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build bundles
run: yarn build:bundle
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_GLOB }}
retention-days: 4
compression-level: 6
overwrite: true
job_check_branches:
name: Check PR branches
needs: job_get_metadata
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: PR is opened against master
uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0
if: ${{ github.base_ref == 'master' && !startsWith(github.head_ref, 'prepare-release/') }}
with:
message: |
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
job_size_check:
name: Size Check
needs: [job_get_metadata, job_build, job_build_bundles]
timeout-minutes: 15
runs-on: ubuntu-24.04
if:
github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Check bundle sizes
uses: ./dev-packages/size-limit-gh-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Only run comparison against develop if this is a PR
comparison_branch: ${{ (github.event_name == 'pull_request' && github.base_ref) || ''}}
job_lint:
name: Lint
# Even though the linter only checks source code, not built code, it needs the built code in order check that all
# inter-package dependencies resolve cleanly.
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Lint source files
run: yarn lint
- name: Lint for ES compatibility
run: yarn lint:es-compatibility
- name: Lint types
run: yarn lint:types
job_check_lockfile:
name: Check lockfile
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
if: |
needs.job_get_metadata.outputs.changed_deps == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install dependencies
run: yarn install --ignore-engines
- name: Check that yarn.lock is stable
run: |
if ! git diff --exit-code yarn.lock; then
echo "::error::yarn.lock has uncommitted changes after running 'yarn install'. Please run 'yarn install' locally and commit the updated yarn.lock."
exit 1
fi
- name: Check for duplicate dependencies in lockfile
run: yarn dedupe-deps:check
job_check_format:
name: Check file formatting
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check file formatting
run: yarn format:check
job_circular_dep_check:
name: Circular Dependency Check
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run madge
run: yarn circularDepCheck
job_artifacts:
name: Upload Artifacts
needs: [job_get_metadata, job_build, job_build_layer, job_build_bundles, job_build_tarballs]
runs-on: ubuntu-24.04
# Build artifacts are only needed for releasing workflow.
if: needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Archive artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}
retention-days: 90
path: |
${{ github.workspace }}/packages/browser/build/bundles/**
${{ github.workspace }}/packages/replay-internal/build/bundles/**
${{ github.workspace }}/packages/replay-canvas/build/bundles/**
${{ github.workspace }}/packages/feedback/build/bundles/**
${{ github.workspace }}/packages/**/*.tgz
${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless/*.zip
job_browser_unit_tests:
name: Browser Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:browser --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
- name: Run all tests
run: yarn test:ci:browser
if: github.event_name != 'pull_request'
job_bun_unit_tests:
name: Bun Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
yarn test:ci:bun
job_deno_unit_tests:
name: Deno Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
cd packages/deno
yarn build
yarn test
job_node_unit_tests:
name: Node (${{ matrix.node }}) Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:node --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
- name: Run all tests
run: yarn test:ci:node
if: github.event_name != 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
job_browser_playwright_tests:
name:
Playwright ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}',
matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04-large-js
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
bundle:
- esm
- bundle
- bundle_min
- bundle_logs_metrics
- bundle_replay
- bundle_replay_logs_metrics
- bundle_tracing
- bundle_tracing_logs_metrics
- bundle_tracing_replay
- bundle_tracing_replay_logs_metrics
- bundle_tracing_replay_feedback
- bundle_tracing_replay_feedback_logs_metrics
- bundle_tracing_replay_feedback_logs_metrics_min
project:
- chromium
include:
# Only check all projects for full bundle
# We also shard the tests as they take the longest
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'webkit'
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'firefox'
- bundle: esm
project: chromium
shard: 1
shards: 4
- bundle: esm
project: chromium
shard: 2
shards: 4
- bundle: esm
project: chromium
shard: 3
shards: 4
- bundle: esm
project: chromium
shard: 4
shards: 4
exclude:
# Do not run the un-sharded esm tests
- bundle: esm
project: 'chromium'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: ${{ matrix.project }}
- name: Run Playwright tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
working-directory: dev-packages/browser-integration-tests
run:
yarn test:all${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard &&
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name:
playwright-traces-job_browser_playwright_tests-${{ matrix.bundle}}-${{matrix.project}}-${{matrix.shard ||
'0'}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_browser_loader_tests:
name: PW ${{ matrix.bundle }} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
bundle:
- loader_base
- loader_eager
- loader_debug
- loader_tracing
- loader_replay
- loader_replay_buffer
- loader_tracing_replay
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
- name: Run Playwright Loader tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
run: |
cd dev-packages/browser-integration-tests
yarn test:loader
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_browser_loader_tests-${{ matrix.bundle}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_check_for_faulty_dts:
name: Check for faulty .d.ts files
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Check for dts files that reference stuff in the temporary build folder
run: |
if grep -r --include "*.d.ts" --exclude-dir ".nx" 'import("@sentry(-internal)?/[^/]*/build' .; then
echo "Found illegal TypeScript import statement."
exit 1
fi
job_node_integration_tests:
name:
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }}${{
(matrix.use_orchestrion && format(' (Orchestrion)', matrix.use_orchestrion)) || '' }} Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_node_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
typescript:
- false
use_orchestrion:
- false
include:
# Only check typescript for latest version (to streamline CI)
- node: 24
typescript: '5.0'
- node: 20.19
use_orchestrion: 'true'
- node: 22
use_orchestrion: 'true'
- node: 24
use_orchestrion: 'true'
- node: 26
use_orchestrion: 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Free up disk space if low
# The full suite pulls several DB docker images (mssql alone is ~1.5GB)
# Available disk space is not consistent, if we detect low space this cleans up some unused toolchains
run: |
df -h /
avail_kb=$(df -k --output=avail / | tail -1)
if [ "$avail_kb" -lt $((40 * 1024 * 1024)) ]; then
echo "Low disk space (<40GB free) — reclaiming unused toolchains"
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
df -h /
else
echo "Sufficient disk space — skipping cleanup"
fi
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Overwrite typescript version
if: matrix.typescript == '5.0'
run: node ./scripts/use-ts-5_0.js
working-directory: dev-packages/node-integration-tests
- name: Run integration tests
working-directory: dev-packages/node-integration-tests
run: yarn test
env:
INJECT_ORCHESTRION: ${{ matrix.use_orchestrion }}
job_cloudflare_integration_tests:
name: Cloudflare Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_cloudflare_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/cloudflare-integration-tests
run: yarn test
job_bundler_plugin_integration_tests:
name: Bundler Plugin Integration Tests (Node ${{ matrix.node }})
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bundler_plugin_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
# The fixtures install the locally-packed `@sentry/bundler-plugins` tarball with pnpm.
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bundler-plugin-integration-tests
run: yarn test
job_bun_integration_tests:
name: Bun Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bun-integration-tests
run: yarn test
job_deno_integration_tests:
name: Deno Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: 'v2.8.0'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build @sentry/deno
working-directory: packages/deno
run: yarn build
- name: Run integration tests
working-directory: dev-packages/deno-integration-tests
run: yarn test
job_build_tarballs:
name: Build tarballs
# We want to run this if:
# - The build job was successful, not skipped
if: |
always() &&
needs.job_build.result == 'success'
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build tarballs
run: yarn build:tarball
- name: Upload tarball artifacts
uses: actions/upload-artifact@v7
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_GLOB }}
if-no-files-found: error
retention-days: 4
compression-level: 6
overwrite: true
job_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_build_tarballs.result == 'success' && needs.job_build.outputs.e2e-matrix !='{"include":[]}'
needs: [job_get_metadata, job_build, job_build_layer, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
# We just use a dummy DSN here, only send to the tunnel anyhow
E2E_TEST_DSN: 'https://username@domain/123'
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
REACT_APP_E2E_TEST_DSN: 'https://username@domain/123'
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Bun
if:
contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "hono-4", "bun-bytecode",
"bun-mysql"]'), matrix.test-application)
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Set up AWS SAM
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Deno
if:
matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed' || matrix.test-application ==
'deno-redis'|| matrix.test-application == 'hono-4' || matrix.test-application == 'deno-mysql' ||
matrix.test-application == 'deno-pg'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Prepare e2e tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate e2e tests setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
path: ${{ runner.temp }}/test-application/test-results
overwrite: true
retention-days: 7
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
# - We skip optional tests on release branches
job_optional_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test (optional)
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_get_metadata.outputs.is_release != 'true' && needs.job_build_tarballs.result == 'success' &&
needs.job_build.outputs.e2e-matrix-optional != '{"include":[]}' && (github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
needs: [job_get_metadata, job_build, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
REACT_APP_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix-optional) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Deno
if: matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Prepare E2E tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate test setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
job_required_jobs_passed:
name: All required jobs passed or were skipped
needs:
[
job_build,
job_build_bundles,
job_build_layer,
job_build_tarballs,
job_browser_unit_tests,
job_bun_unit_tests,
job_deno_unit_tests,
job_node_unit_tests,
job_node_integration_tests,
job_cloudflare_integration_tests,
job_bundler_plugin_integration_tests,
job_bun_integration_tests,
job_deno_integration_tests,
job_browser_playwright_tests,
job_browser_loader_tests,
job_e2e_tests,
job_artifacts,
job_lint,
job_check_lockfile,
job_check_format,
job_circular_dep_check,
job_size_check,
]
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-24.04
permissions:
issues: write
checks: read
steps:
- name: Check out current commit
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
scripts
- name: Create issues for failed jobs
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/github-script@v9
with:
script: |
const { default: run } = await import(
`${process.env.GITHUB_WORKSPACE}/scripts/report-ci-failures.mjs`
);
await run({ github, context, core });
- name: Check for failures
if: cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(core): Use wall clock for structured log timestamps · getsentry/sentry-javascript@3aea457 · GitHub
Skip to content

fix(core): Use wall clock for structured log timestamps #52683

fix(core): Use wall clock for structured log timestamps

fix(core): Use wall clock for structured log timestamps #52683

Workflow file for this run

name: 'CI: Build & Test'
on:
push:
branches:
- develop
- master
- v10
- v9
- v8
- release/**
pull_request:
merge_group:
types: [checks_requested]
workflow_dispatch:
inputs:
commit:
description: If the commit you want to test isn't the head of a branch, provide its SHA here
required: false
schedule:
# Run every day at midnight (without cache)
- cron: '0 0 * * *'
# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
CACHED_DEPENDENCY_PATHS: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/packages/*/node_modules
${{ github.workspace }}/dev-packages/*/node_modules
~/.cache/mongodb-binaries/
# DEPENDENCY_CACHE_KEY: can't be set here because we don't have access to yarn.lock
# build-output artifact paths are computed in job_build (step output from
# yarn ci:print-build-artifact-paths — Nx merged outputs for build:transpile, and build:types).
# upload-artifact globs drop the path through the first `*` (see upload-artifact
# README). Tarballs therefore land in the artifact as <pkg>/*.tgz; download
# build-tarball-output into packages/ so they resolve to packages/<pkg>/*.tgz.
TARBALL_ARTIFACT_GLOB: packages/*/*.tgz
TARBALL_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
BUILD_LAYER_PATH: ${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless
# Same glob / download split as TARBALL_ARTIFACT_*: upload-artifact strips the path through
# the first `*`, so bundle trees are stored as <pkg>/build/bundles/...; download into packages/.
BUNDLE_ARTIFACT_GLOB: packages/*/build/bundles
BUNDLE_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
NX_CACHE_KEY: nx-Linux-${{ github.head_ref || github.ref }}-${{ github.run_id }}
# https://bsky.app/profile/joyeecheung.bsky.social/post/3lhy6o54fo22h
# Apparently some of our CI failures are attributable to a corrupt v8 cache, causing v8 failures with: "Check failed: current == end_slot_index.".
# This option both controls the `v8-compile-cache-lib` and `v8-compile-cache` packages.
DISABLE_V8_COMPILE_CACHE: '1'
jobs:
job_get_metadata:
uses: ./.github/workflows/ci-metadata.yml
name: Get CI Metadata
with:
head_commit: ${{ github.event.inputs.commit || github.sha }}
permissions:
pull-requests: read
job_build:
name: Build
needs: job_get_metadata
runs-on: ubuntu-24.04
timeout-minutes: 15
if: |
needs.job_get_metadata.outputs.changed_any_code == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true' ||
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false' && needs.job_get_metadata.outputs.changed_any_code == 'true')
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check for Affected Nx Projects
uses: ./.github/actions/nx-affected-list
id: checkForAffected
if: github.event_name == 'pull_request'
with:
base: ${{ github.event.pull_request.base.sha }}
head: ${{ env.HEAD_COMMIT }}
- name: Build packages
run: yarn build:ci
- name: Compute build artifact paths from Nx
id: nx_build_paths
run: |
{
echo 'paths<<EOF'
yarn --silent ci:print-build-artifact-paths
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Store NX cache
uses: actions/cache/save@v5
# Only cache this per-PR to speed up CI.
if: github.event_name == 'pull_request'
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-output
path: ${{ steps.nx_build_paths.outputs.paths }}
retention-days: 4
compression-level: 6
overwrite: true
- name: Determine which test applications should be run
id: matrix
run:
yarn --silent ci:build-matrix --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
- name: Determine which optional E2E test applications should be run
id: matrix-optional
run:
yarn --silent ci:build-matrix-optional --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
outputs:
dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }}
changed_node_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/node-integration-tests') }}
changed_node:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/node') }}
changed_deno:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/deno') }}
changed_bun:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/bun') }}
changed_bun_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bun-integration-tests') }}
changed_deno_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/deno-integration-tests') }}
changed_browser_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/browser-integration-tests') }}
changed_cloudflare_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/cloudflare-integration-tests') }}
changed_bundler_plugin_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bundler-plugin-integration-tests') }}
changed_aws_serverless:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/aws-serverless') }}
e2e-matrix: ${{ steps.matrix.outputs.matrix }}
e2e-matrix-optional: ${{ steps.matrix-optional.outputs.matrix }}
job_build_layer:
name: Build Lambda layer
needs: [job_get_metadata, job_build]
if:
needs.job_build.outputs.changed_aws_serverless == 'true' || contains(needs.job_build.outputs.e2e-matrix,
'aws-serverless') || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build Lambda layer
run: yarn build:layer
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
retention-days: 4
compression-level: 6
overwrite: true
job_build_bundles:
name: Build bundles
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build bundles
run: yarn build:bundle
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_GLOB }}
retention-days: 4
compression-level: 6
overwrite: true
job_check_branches:
name: Check PR branches
needs: job_get_metadata
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: PR is opened against master
uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0
if: ${{ github.base_ref == 'master' && !startsWith(github.head_ref, 'prepare-release/') }}
with:
message: |
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
job_size_check:
name: Size Check
needs: [job_get_metadata, job_build, job_build_bundles]
timeout-minutes: 15
runs-on: ubuntu-24.04
if:
github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Check bundle sizes
uses: ./dev-packages/size-limit-gh-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Only run comparison against develop if this is a PR
comparison_branch: ${{ (github.event_name == 'pull_request' && github.base_ref) || ''}}
job_lint:
name: Lint
# Even though the linter only checks source code, not built code, it needs the built code in order check that all
# inter-package dependencies resolve cleanly.
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Lint source files
run: yarn lint
- name: Lint for ES compatibility
run: yarn lint:es-compatibility
- name: Lint types
run: yarn lint:types
job_check_lockfile:
name: Check lockfile
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
if: |
needs.job_get_metadata.outputs.changed_deps == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install dependencies
run: yarn install --ignore-engines
- name: Check that yarn.lock is stable
run: |
if ! git diff --exit-code yarn.lock; then
echo "::error::yarn.lock has uncommitted changes after running 'yarn install'. Please run 'yarn install' locally and commit the updated yarn.lock."
exit 1
fi
- name: Check for duplicate dependencies in lockfile
run: yarn dedupe-deps:check
job_check_format:
name: Check file formatting
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check file formatting
run: yarn format:check
job_circular_dep_check:
name: Circular Dependency Check
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run madge
run: yarn circularDepCheck
job_artifacts:
name: Upload Artifacts
needs: [job_get_metadata, job_build, job_build_layer, job_build_bundles, job_build_tarballs]
runs-on: ubuntu-24.04
# Build artifacts are only needed for releasing workflow.
if: needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Archive artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}
retention-days: 90
path: |
${{ github.workspace }}/packages/browser/build/bundles/**
${{ github.workspace }}/packages/replay-internal/build/bundles/**
${{ github.workspace }}/packages/replay-canvas/build/bundles/**
${{ github.workspace }}/packages/feedback/build/bundles/**
${{ github.workspace }}/packages/**/*.tgz
${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless/*.zip
job_browser_unit_tests:
name: Browser Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:browser --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
- name: Run all tests
run: yarn test:ci:browser
if: github.event_name != 'pull_request'
job_bun_unit_tests:
name: Bun Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
yarn test:ci:bun
job_deno_unit_tests:
name: Deno Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
cd packages/deno
yarn build
yarn test
job_node_unit_tests:
name: Node (${{ matrix.node }}) Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:node --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
- name: Run all tests
run: yarn test:ci:node
if: github.event_name != 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
job_browser_playwright_tests:
name:
Playwright ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}',
matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04-large-js
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
bundle:
- esm
- bundle
- bundle_min
- bundle_logs_metrics
- bundle_replay
- bundle_replay_logs_metrics
- bundle_tracing
- bundle_tracing_logs_metrics
- bundle_tracing_replay
- bundle_tracing_replay_logs_metrics
- bundle_tracing_replay_feedback
- bundle_tracing_replay_feedback_logs_metrics
- bundle_tracing_replay_feedback_logs_metrics_min
project:
- chromium
include:
# Only check all projects for full bundle
# We also shard the tests as they take the longest
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'webkit'
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'firefox'
- bundle: esm
project: chromium
shard: 1
shards: 4
- bundle: esm
project: chromium
shard: 2
shards: 4
- bundle: esm
project: chromium
shard: 3
shards: 4
- bundle: esm
project: chromium
shard: 4
shards: 4
exclude:
# Do not run the un-sharded esm tests
- bundle: esm
project: 'chromium'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: ${{ matrix.project }}
- name: Run Playwright tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
working-directory: dev-packages/browser-integration-tests
run:
yarn test:all${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard &&
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name:
playwright-traces-job_browser_playwright_tests-${{ matrix.bundle}}-${{matrix.project}}-${{matrix.shard ||
'0'}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_browser_loader_tests:
name: PW ${{ matrix.bundle }} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
bundle:
- loader_base
- loader_eager
- loader_debug
- loader_tracing
- loader_replay
- loader_replay_buffer
- loader_tracing_replay
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
- name: Run Playwright Loader tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
run: |
cd dev-packages/browser-integration-tests
yarn test:loader
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_browser_loader_tests-${{ matrix.bundle}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_check_for_faulty_dts:
name: Check for faulty .d.ts files
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Check for dts files that reference stuff in the temporary build folder
run: |
if grep -r --include "*.d.ts" --exclude-dir ".nx" 'import("@sentry(-internal)?/[^/]*/build' .; then
echo "Found illegal TypeScript import statement."
exit 1
fi
job_node_integration_tests:
name:
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }}${{
(matrix.use_orchestrion && format(' (Orchestrion)', matrix.use_orchestrion)) || '' }} Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_node_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
typescript:
- false
use_orchestrion:
- false
include:
# Only check typescript for latest version (to streamline CI)
- node: 24
typescript: '5.0'
- node: 20.19
use_orchestrion: 'true'
- node: 22
use_orchestrion: 'true'
- node: 24
use_orchestrion: 'true'
- node: 26
use_orchestrion: 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Free up disk space if low
# The full suite pulls several DB docker images (mssql alone is ~1.5GB)
# Available disk space is not consistent, if we detect low space this cleans up some unused toolchains
run: |
df -h /
avail_kb=$(df -k --output=avail / | tail -1)
if [ "$avail_kb" -lt $((40 * 1024 * 1024)) ]; then
echo "Low disk space (<40GB free) — reclaiming unused toolchains"
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
df -h /
else
echo "Sufficient disk space — skipping cleanup"
fi
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Overwrite typescript version
if: matrix.typescript == '5.0'
run: node ./scripts/use-ts-5_0.js
working-directory: dev-packages/node-integration-tests
- name: Run integration tests
working-directory: dev-packages/node-integration-tests
run: yarn test
env:
INJECT_ORCHESTRION: ${{ matrix.use_orchestrion }}
job_cloudflare_integration_tests:
name: Cloudflare Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_cloudflare_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/cloudflare-integration-tests
run: yarn test
job_bundler_plugin_integration_tests:
name: Bundler Plugin Integration Tests (Node ${{ matrix.node }})
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bundler_plugin_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
# The fixtures install the locally-packed `@sentry/bundler-plugins` tarball with pnpm.
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bundler-plugin-integration-tests
run: yarn test
job_bun_integration_tests:
name: Bun Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bun-integration-tests
run: yarn test
job_deno_integration_tests:
name: Deno Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: 'v2.8.0'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build @sentry/deno
working-directory: packages/deno
run: yarn build
- name: Run integration tests
working-directory: dev-packages/deno-integration-tests
run: yarn test
job_build_tarballs:
name: Build tarballs
# We want to run this if:
# - The build job was successful, not skipped
if: |
always() &&
needs.job_build.result == 'success'
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build tarballs
run: yarn build:tarball
- name: Upload tarball artifacts
uses: actions/upload-artifact@v7
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_GLOB }}
if-no-files-found: error
retention-days: 4
compression-level: 6
overwrite: true
job_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_build_tarballs.result == 'success' && needs.job_build.outputs.e2e-matrix !='{"include":[]}'
needs: [job_get_metadata, job_build, job_build_layer, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
# We just use a dummy DSN here, only send to the tunnel anyhow
E2E_TEST_DSN: 'https://username@domain/123'
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
REACT_APP_E2E_TEST_DSN: 'https://username@domain/123'
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Bun
if:
contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "hono-4", "bun-bytecode",
"bun-mysql"]'), matrix.test-application)
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Set up AWS SAM
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Deno
if:
matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed' || matrix.test-application ==
'deno-redis'|| matrix.test-application == 'hono-4' || matrix.test-application == 'deno-mysql' ||
matrix.test-application == 'deno-pg'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Prepare e2e tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate e2e tests setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
path: ${{ runner.temp }}/test-application/test-results
overwrite: true
retention-days: 7
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
# - We skip optional tests on release branches
job_optional_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test (optional)
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_get_metadata.outputs.is_release != 'true' && needs.job_build_tarballs.result == 'success' &&
needs.job_build.outputs.e2e-matrix-optional != '{"include":[]}' && (github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
needs: [job_get_metadata, job_build, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
REACT_APP_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix-optional) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Deno
if: matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Prepare E2E tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate test setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
job_required_jobs_passed:
name: All required jobs passed or were skipped
needs:
[
job_build,
job_build_bundles,
job_build_layer,
job_build_tarballs,
job_browser_unit_tests,
job_bun_unit_tests,
job_deno_unit_tests,
job_node_unit_tests,
job_node_integration_tests,
job_cloudflare_integration_tests,
job_bundler_plugin_integration_tests,
job_bun_integration_tests,
job_deno_integration_tests,
job_browser_playwright_tests,
job_browser_loader_tests,
job_e2e_tests,
job_artifacts,
job_lint,
job_check_lockfile,
job_check_format,
job_circular_dep_check,
job_size_check,
]
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-24.04
permissions:
issues: write
checks: read
steps:
- name: Check out current commit
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
scripts
- name: Create issues for failed jobs
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/github-script@v9
with:
script: |
const { default: run } = await import(
`${process.env.GITHUB_WORKSPACE}/scripts/report-ci-failures.mjs`
);
await run({ github, context, core });
- name: Check for failures
if: cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix(core): Use wall clock for structured log timestamps · getsentry/sentry-javascript@3aea457 · GitHub
Skip to content

fix(core): Use wall clock for structured log timestamps #52683

fix(core): Use wall clock for structured log timestamps

fix(core): Use wall clock for structured log timestamps #52683

Workflow file for this run

name: 'CI: Build & Test'
on:
push:
branches:
- develop
- master
- v10
- v9
- v8
- release/**
pull_request:
merge_group:
types: [checks_requested]
workflow_dispatch:
inputs:
commit:
description: If the commit you want to test isn't the head of a branch, provide its SHA here
required: false
schedule:
# Run every day at midnight (without cache)
- cron: '0 0 * * *'
# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
CACHED_DEPENDENCY_PATHS: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/packages/*/node_modules
${{ github.workspace }}/dev-packages/*/node_modules
~/.cache/mongodb-binaries/
# DEPENDENCY_CACHE_KEY: can't be set here because we don't have access to yarn.lock
# build-output artifact paths are computed in job_build (step output from
# yarn ci:print-build-artifact-paths — Nx merged outputs for build:transpile, and build:types).
# upload-artifact globs drop the path through the first `*` (see upload-artifact
# README). Tarballs therefore land in the artifact as <pkg>/*.tgz; download
# build-tarball-output into packages/ so they resolve to packages/<pkg>/*.tgz.
TARBALL_ARTIFACT_GLOB: packages/*/*.tgz
TARBALL_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
BUILD_LAYER_PATH: ${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless
# Same glob / download split as TARBALL_ARTIFACT_*: upload-artifact strips the path through
# the first `*`, so bundle trees are stored as <pkg>/build/bundles/...; download into packages/.
BUNDLE_ARTIFACT_GLOB: packages/*/build/bundles
BUNDLE_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
NX_CACHE_KEY: nx-Linux-${{ github.head_ref || github.ref }}-${{ github.run_id }}
# https://bsky.app/profile/joyeecheung.bsky.social/post/3lhy6o54fo22h
# Apparently some of our CI failures are attributable to a corrupt v8 cache, causing v8 failures with: "Check failed: current == end_slot_index.".
# This option both controls the `v8-compile-cache-lib` and `v8-compile-cache` packages.
DISABLE_V8_COMPILE_CACHE: '1'
jobs:
job_get_metadata:
uses: ./.github/workflows/ci-metadata.yml
name: Get CI Metadata
with:
head_commit: ${{ github.event.inputs.commit || github.sha }}
permissions:
pull-requests: read
job_build:
name: Build
needs: job_get_metadata
runs-on: ubuntu-24.04
timeout-minutes: 15
if: |
needs.job_get_metadata.outputs.changed_any_code == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true' ||
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false' && needs.job_get_metadata.outputs.changed_any_code == 'true')
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check for Affected Nx Projects
uses: ./.github/actions/nx-affected-list
id: checkForAffected
if: github.event_name == 'pull_request'
with:
base: ${{ github.event.pull_request.base.sha }}
head: ${{ env.HEAD_COMMIT }}
- name: Build packages
run: yarn build:ci
- name: Compute build artifact paths from Nx
id: nx_build_paths
run: |
{
echo 'paths<<EOF'
yarn --silent ci:print-build-artifact-paths
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Store NX cache
uses: actions/cache/save@v5
# Only cache this per-PR to speed up CI.
if: github.event_name == 'pull_request'
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-output
path: ${{ steps.nx_build_paths.outputs.paths }}
retention-days: 4
compression-level: 6
overwrite: true
- name: Determine which test applications should be run
id: matrix
run:
yarn --silent ci:build-matrix --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
- name: Determine which optional E2E test applications should be run
id: matrix-optional
run:
yarn --silent ci:build-matrix-optional --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
outputs:
dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }}
changed_node_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/node-integration-tests') }}
changed_node:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/node') }}
changed_deno:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/deno') }}
changed_bun:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/bun') }}
changed_bun_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bun-integration-tests') }}
changed_deno_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/deno-integration-tests') }}
changed_browser_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/browser-integration-tests') }}
changed_cloudflare_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/cloudflare-integration-tests') }}
changed_bundler_plugin_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bundler-plugin-integration-tests') }}
changed_aws_serverless:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/aws-serverless') }}
e2e-matrix: ${{ steps.matrix.outputs.matrix }}
e2e-matrix-optional: ${{ steps.matrix-optional.outputs.matrix }}
job_build_layer:
name: Build Lambda layer
needs: [job_get_metadata, job_build]
if:
needs.job_build.outputs.changed_aws_serverless == 'true' || contains(needs.job_build.outputs.e2e-matrix,
'aws-serverless') || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build Lambda layer
run: yarn build:layer
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
retention-days: 4
compression-level: 6
overwrite: true
job_build_bundles:
name: Build bundles
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build bundles
run: yarn build:bundle
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_GLOB }}
retention-days: 4
compression-level: 6
overwrite: true
job_check_branches:
name: Check PR branches
needs: job_get_metadata
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: PR is opened against master
uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0
if: ${{ github.base_ref == 'master' && !startsWith(github.head_ref, 'prepare-release/') }}
with:
message: |
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
job_size_check:
name: Size Check
needs: [job_get_metadata, job_build, job_build_bundles]
timeout-minutes: 15
runs-on: ubuntu-24.04
if:
github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Check bundle sizes
uses: ./dev-packages/size-limit-gh-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Only run comparison against develop if this is a PR
comparison_branch: ${{ (github.event_name == 'pull_request' && github.base_ref) || ''}}
job_lint:
name: Lint
# Even though the linter only checks source code, not built code, it needs the built code in order check that all
# inter-package dependencies resolve cleanly.
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Lint source files
run: yarn lint
- name: Lint for ES compatibility
run: yarn lint:es-compatibility
- name: Lint types
run: yarn lint:types
job_check_lockfile:
name: Check lockfile
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
if: |
needs.job_get_metadata.outputs.changed_deps == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install dependencies
run: yarn install --ignore-engines
- name: Check that yarn.lock is stable
run: |
if ! git diff --exit-code yarn.lock; then
echo "::error::yarn.lock has uncommitted changes after running 'yarn install'. Please run 'yarn install' locally and commit the updated yarn.lock."
exit 1
fi
- name: Check for duplicate dependencies in lockfile
run: yarn dedupe-deps:check
job_check_format:
name: Check file formatting
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check file formatting
run: yarn format:check
job_circular_dep_check:
name: Circular Dependency Check
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run madge
run: yarn circularDepCheck
job_artifacts:
name: Upload Artifacts
needs: [job_get_metadata, job_build, job_build_layer, job_build_bundles, job_build_tarballs]
runs-on: ubuntu-24.04
# Build artifacts are only needed for releasing workflow.
if: needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Archive artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}
retention-days: 90
path: |
${{ github.workspace }}/packages/browser/build/bundles/**
${{ github.workspace }}/packages/replay-internal/build/bundles/**
${{ github.workspace }}/packages/replay-canvas/build/bundles/**
${{ github.workspace }}/packages/feedback/build/bundles/**
${{ github.workspace }}/packages/**/*.tgz
${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless/*.zip
job_browser_unit_tests:
name: Browser Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:browser --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
- name: Run all tests
run: yarn test:ci:browser
if: github.event_name != 'pull_request'
job_bun_unit_tests:
name: Bun Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
yarn test:ci:bun
job_deno_unit_tests:
name: Deno Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
cd packages/deno
yarn build
yarn test
job_node_unit_tests:
name: Node (${{ matrix.node }}) Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:node --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
- name: Run all tests
run: yarn test:ci:node
if: github.event_name != 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
job_browser_playwright_tests:
name:
Playwright ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}',
matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04-large-js
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
bundle:
- esm
- bundle
- bundle_min
- bundle_logs_metrics
- bundle_replay
- bundle_replay_logs_metrics
- bundle_tracing
- bundle_tracing_logs_metrics
- bundle_tracing_replay
- bundle_tracing_replay_logs_metrics
- bundle_tracing_replay_feedback
- bundle_tracing_replay_feedback_logs_metrics
- bundle_tracing_replay_feedback_logs_metrics_min
project:
- chromium
include:
# Only check all projects for full bundle
# We also shard the tests as they take the longest
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'webkit'
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'firefox'
- bundle: esm
project: chromium
shard: 1
shards: 4
- bundle: esm
project: chromium
shard: 2
shards: 4
- bundle: esm
project: chromium
shard: 3
shards: 4
- bundle: esm
project: chromium
shard: 4
shards: 4
exclude:
# Do not run the un-sharded esm tests
- bundle: esm
project: 'chromium'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: ${{ matrix.project }}
- name: Run Playwright tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
working-directory: dev-packages/browser-integration-tests
run:
yarn test:all${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard &&
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name:
playwright-traces-job_browser_playwright_tests-${{ matrix.bundle}}-${{matrix.project}}-${{matrix.shard ||
'0'}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_browser_loader_tests:
name: PW ${{ matrix.bundle }} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
bundle:
- loader_base
- loader_eager
- loader_debug
- loader_tracing
- loader_replay
- loader_replay_buffer
- loader_tracing_replay
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
- name: Run Playwright Loader tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
run: |
cd dev-packages/browser-integration-tests
yarn test:loader
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_browser_loader_tests-${{ matrix.bundle}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_check_for_faulty_dts:
name: Check for faulty .d.ts files
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Check for dts files that reference stuff in the temporary build folder
run: |
if grep -r --include "*.d.ts" --exclude-dir ".nx" 'import("@sentry(-internal)?/[^/]*/build' .; then
echo "Found illegal TypeScript import statement."
exit 1
fi
job_node_integration_tests:
name:
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }}${{
(matrix.use_orchestrion && format(' (Orchestrion)', matrix.use_orchestrion)) || '' }} Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_node_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
typescript:
- false
use_orchestrion:
- false
include:
# Only check typescript for latest version (to streamline CI)
- node: 24
typescript: '5.0'
- node: 20.19
use_orchestrion: 'true'
- node: 22
use_orchestrion: 'true'
- node: 24
use_orchestrion: 'true'
- node: 26
use_orchestrion: 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Free up disk space if low
# The full suite pulls several DB docker images (mssql alone is ~1.5GB)
# Available disk space is not consistent, if we detect low space this cleans up some unused toolchains
run: |
df -h /
avail_kb=$(df -k --output=avail / | tail -1)
if [ "$avail_kb" -lt $((40 * 1024 * 1024)) ]; then
echo "Low disk space (<40GB free) — reclaiming unused toolchains"
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
df -h /
else
echo "Sufficient disk space — skipping cleanup"
fi
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Overwrite typescript version
if: matrix.typescript == '5.0'
run: node ./scripts/use-ts-5_0.js
working-directory: dev-packages/node-integration-tests
- name: Run integration tests
working-directory: dev-packages/node-integration-tests
run: yarn test
env:
INJECT_ORCHESTRION: ${{ matrix.use_orchestrion }}
job_cloudflare_integration_tests:
name: Cloudflare Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_cloudflare_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/cloudflare-integration-tests
run: yarn test
job_bundler_plugin_integration_tests:
name: Bundler Plugin Integration Tests (Node ${{ matrix.node }})
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bundler_plugin_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
# The fixtures install the locally-packed `@sentry/bundler-plugins` tarball with pnpm.
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bundler-plugin-integration-tests
run: yarn test
job_bun_integration_tests:
name: Bun Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bun-integration-tests
run: yarn test
job_deno_integration_tests:
name: Deno Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: 'v2.8.0'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build @sentry/deno
working-directory: packages/deno
run: yarn build
- name: Run integration tests
working-directory: dev-packages/deno-integration-tests
run: yarn test
job_build_tarballs:
name: Build tarballs
# We want to run this if:
# - The build job was successful, not skipped
if: |
always() &&
needs.job_build.result == 'success'
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build tarballs
run: yarn build:tarball
- name: Upload tarball artifacts
uses: actions/upload-artifact@v7
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_GLOB }}
if-no-files-found: error
retention-days: 4
compression-level: 6
overwrite: true
job_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_build_tarballs.result == 'success' && needs.job_build.outputs.e2e-matrix !='{"include":[]}'
needs: [job_get_metadata, job_build, job_build_layer, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
# We just use a dummy DSN here, only send to the tunnel anyhow
E2E_TEST_DSN: 'https://username@domain/123'
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
REACT_APP_E2E_TEST_DSN: 'https://username@domain/123'
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Bun
if:
contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "hono-4", "bun-bytecode",
"bun-mysql"]'), matrix.test-application)
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Set up AWS SAM
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Deno
if:
matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed' || matrix.test-application ==
'deno-redis'|| matrix.test-application == 'hono-4' || matrix.test-application == 'deno-mysql' ||
matrix.test-application == 'deno-pg'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Prepare e2e tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate e2e tests setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
path: ${{ runner.temp }}/test-application/test-results
overwrite: true
retention-days: 7
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
# - We skip optional tests on release branches
job_optional_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test (optional)
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_get_metadata.outputs.is_release != 'true' && needs.job_build_tarballs.result == 'success' &&
needs.job_build.outputs.e2e-matrix-optional != '{"include":[]}' && (github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
needs: [job_get_metadata, job_build, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
REACT_APP_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix-optional) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Deno
if: matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Prepare E2E tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate test setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
job_required_jobs_passed:
name: All required jobs passed or were skipped
needs:
[
job_build,
job_build_bundles,
job_build_layer,
job_build_tarballs,
job_browser_unit_tests,
job_bun_unit_tests,
job_deno_unit_tests,
job_node_unit_tests,
job_node_integration_tests,
job_cloudflare_integration_tests,
job_bundler_plugin_integration_tests,
job_bun_integration_tests,
job_deno_integration_tests,
job_browser_playwright_tests,
job_browser_loader_tests,
job_e2e_tests,
job_artifacts,
job_lint,
job_check_lockfile,
job_check_format,
job_circular_dep_check,
job_size_check,
]
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-24.04
permissions:
issues: write
checks: read
steps:
- name: Check out current commit
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
scripts
- name: Create issues for failed jobs
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/github-script@v9
with:
script: |
const { default: run } = await import(
`${process.env.GITHUB_WORKSPACE}/scripts/report-ci-failures.mjs`
);
await run({ github, context, core });
- name: Check for failures
if: cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); fix(core): Use wall clock for structured log timestamps · getsentry/sentry-javascript@3aea457 · GitHub
Skip to content

fix(core): Use wall clock for structured log timestamps #52683

fix(core): Use wall clock for structured log timestamps

fix(core): Use wall clock for structured log timestamps #52683

Workflow file for this run

name: 'CI: Build & Test'
on:
push:
branches:
- develop
- master
- v10
- v9
- v8
- release/**
pull_request:
merge_group:
types: [checks_requested]
workflow_dispatch:
inputs:
commit:
description: If the commit you want to test isn't the head of a branch, provide its SHA here
required: false
schedule:
# Run every day at midnight (without cache)
- cron: '0 0 * * *'
# Cancel in progress workflows on pull_requests.
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
HEAD_COMMIT: ${{ github.event.inputs.commit || github.sha }}
CACHED_DEPENDENCY_PATHS: |
${{ github.workspace }}/node_modules
${{ github.workspace }}/packages/*/node_modules
${{ github.workspace }}/dev-packages/*/node_modules
~/.cache/mongodb-binaries/
# DEPENDENCY_CACHE_KEY: can't be set here because we don't have access to yarn.lock
# build-output artifact paths are computed in job_build (step output from
# yarn ci:print-build-artifact-paths — Nx merged outputs for build:transpile, and build:types).
# upload-artifact globs drop the path through the first `*` (see upload-artifact
# README). Tarballs therefore land in the artifact as <pkg>/*.tgz; download
# build-tarball-output into packages/ so they resolve to packages/<pkg>/*.tgz.
TARBALL_ARTIFACT_GLOB: packages/*/*.tgz
TARBALL_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
BUILD_LAYER_PATH: ${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless
# Same glob / download split as TARBALL_ARTIFACT_*: upload-artifact strips the path through
# the first `*`, so bundle trees are stored as <pkg>/build/bundles/...; download into packages/.
BUNDLE_ARTIFACT_GLOB: packages/*/build/bundles
BUNDLE_ARTIFACT_DOWNLOAD_PATH: ${{ github.workspace }}/packages
NX_CACHE_KEY: nx-Linux-${{ github.head_ref || github.ref }}-${{ github.run_id }}
# https://bsky.app/profile/joyeecheung.bsky.social/post/3lhy6o54fo22h
# Apparently some of our CI failures are attributable to a corrupt v8 cache, causing v8 failures with: "Check failed: current == end_slot_index.".
# This option both controls the `v8-compile-cache-lib` and `v8-compile-cache` packages.
DISABLE_V8_COMPILE_CACHE: '1'
jobs:
job_get_metadata:
uses: ./.github/workflows/ci-metadata.yml
name: Get CI Metadata
with:
head_commit: ${{ github.event.inputs.commit || github.sha }}
permissions:
pull-requests: read
job_build:
name: Build
needs: job_get_metadata
runs-on: ubuntu-24.04
timeout-minutes: 15
if: |
needs.job_get_metadata.outputs.changed_any_code == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true' ||
(needs.job_get_metadata.outputs.is_gitflow_sync == 'false' && needs.job_get_metadata.outputs.has_gitflow_label == 'false' && needs.job_get_metadata.outputs.changed_any_code == 'true')
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: 'Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})'
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check for Affected Nx Projects
uses: ./.github/actions/nx-affected-list
id: checkForAffected
if: github.event_name == 'pull_request'
with:
base: ${{ github.event.pull_request.base.sha }}
head: ${{ env.HEAD_COMMIT }}
- name: Build packages
run: yarn build:ci
- name: Compute build artifact paths from Nx
id: nx_build_paths
run: |
{
echo 'paths<<EOF'
yarn --silent ci:print-build-artifact-paths
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Store NX cache
uses: actions/cache/save@v5
# Only cache this per-PR to speed up CI.
if: github.event_name == 'pull_request'
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-output
path: ${{ steps.nx_build_paths.outputs.paths }}
retention-days: 4
compression-level: 6
overwrite: true
- name: Determine which test applications should be run
id: matrix
run:
yarn --silent ci:build-matrix --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
- name: Determine which optional E2E test applications should be run
id: matrix-optional
run:
yarn --silent ci:build-matrix-optional --base=${{ (github.event_name == 'pull_request' &&
github.event.pull_request.base.sha) || '' }} >> $GITHUB_OUTPUT
working-directory: dev-packages/e2e-tests
outputs:
dependency_cache_key: ${{ steps.install_dependencies.outputs.cache_key }}
changed_node_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/node-integration-tests') }}
changed_node:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/node') }}
changed_deno:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/deno') }}
changed_bun:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/bun') }}
changed_bun_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bun-integration-tests') }}
changed_deno_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/deno-integration-tests') }}
changed_browser_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/browser-integration-tests') }}
changed_cloudflare_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/cloudflare-integration-tests') }}
changed_bundler_plugin_integration:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry-internal/bundler-plugin-integration-tests') }}
changed_aws_serverless:
${{ needs.job_get_metadata.outputs.changed_ci == 'true' || contains(steps.checkForAffected.outputs.affected,
'@sentry/aws-serverless') }}
e2e-matrix: ${{ steps.matrix.outputs.matrix }}
e2e-matrix-optional: ${{ steps.matrix-optional.outputs.matrix }}
job_build_layer:
name: Build Lambda layer
needs: [job_get_metadata, job_build]
if:
needs.job_build.outputs.changed_aws_serverless == 'true' || contains(needs.job_build.outputs.e2e-matrix,
'aws-serverless') || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build Lambda layer
run: yarn build:layer
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
retention-days: 4
compression-level: 6
overwrite: true
job_build_bundles:
name: Build bundles
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build bundles
run: yarn build:bundle
- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_GLOB }}
retention-days: 4
compression-level: 6
overwrite: true
job_check_branches:
name: Check PR branches
needs: job_get_metadata
runs-on: ubuntu-24.04
if: github.event_name == 'pull_request'
permissions:
pull-requests: write
steps:
- name: PR is opened against master
uses: mshick/add-pr-comment@8e4927817251f1ff60c001f04568532b38e0b4a0
if: ${{ github.base_ref == 'master' && !startsWith(github.head_ref, 'prepare-release/') }}
with:
message: |
⚠️ This PR is opened against **master**. You probably want to open it against **develop**.
job_size_check:
name: Size Check
needs: [job_get_metadata, job_build, job_build_bundles]
timeout-minutes: 15
runs-on: ubuntu-24.04
if:
github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Check bundle sizes
uses: ./dev-packages/size-limit-gh-action
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Only run comparison against develop if this is a PR
comparison_branch: ${{ (github.event_name == 'pull_request' && github.base_ref) || ''}}
job_lint:
name: Lint
# Even though the linter only checks source code, not built code, it needs the built code in order check that all
# inter-package dependencies resolve cleanly.
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Lint source files
run: yarn lint
- name: Lint for ES compatibility
run: yarn lint:es-compatibility
- name: Lint types
run: yarn lint:types
job_check_lockfile:
name: Check lockfile
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
if: |
needs.job_get_metadata.outputs.changed_deps == 'true' ||
needs.job_get_metadata.outputs.is_base_branch == 'true' ||
needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install dependencies
run: yarn install --ignore-engines
- name: Check that yarn.lock is stable
run: |
if ! git diff --exit-code yarn.lock; then
echo "::error::yarn.lock has uncommitted changes after running 'yarn install'. Please run 'yarn install' locally and commit the updated yarn.lock."
exit 1
fi
- name: Check for duplicate dependencies in lockfile
run: yarn dedupe-deps:check
job_check_format:
name: Check file formatting
needs: [job_get_metadata]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Install Dependencies
uses: ./.github/actions/install-dependencies
id: install_dependencies
- name: Check file formatting
run: yarn format:check
job_circular_dep_check:
name: Circular Dependency Check
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run madge
run: yarn circularDepCheck
job_artifacts:
name: Upload Artifacts
needs: [job_get_metadata, job_build, job_build_layer, job_build_bundles, job_build_tarballs]
runs-on: ubuntu-24.04
# Build artifacts are only needed for releasing workflow.
if: needs.job_get_metadata.outputs.is_release == 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Archive artifacts
uses: actions/upload-artifact@v7
with:
name: ${{ github.sha }}
retention-days: 90
path: |
${{ github.workspace }}/packages/browser/build/bundles/**
${{ github.workspace }}/packages/replay-internal/build/bundles/**
${{ github.workspace }}/packages/replay-canvas/build/bundles/**
${{ github.workspace }}/packages/feedback/build/bundles/**
${{ github.workspace }}/packages/**/*.tgz
${{ github.workspace }}/packages/aws-serverless/build/aws/dist-serverless/*.zip
job_browser_unit_tests:
name: Browser Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:browser --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
- name: Run all tests
run: yarn test:ci:browser
if: github.event_name != 'pull_request'
job_bun_unit_tests:
name: Bun Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
yarn test:ci:bun
job_deno_unit_tests:
name: Deno Unit Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno == 'true' || github.event_name != 'pull_request'
timeout-minutes: 10
runs-on: ubuntu-24.04
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run tests
run: |
cd packages/deno
yarn build
yarn test
job_node_unit_tests:
name: Node (${{ matrix.node }}) Unit Tests
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out base commit (${{ github.event.pull_request.base.sha }})
uses: actions/checkout@v7
if: github.event_name == 'pull_request'
with:
ref: ${{ github.event.pull_request.base.sha }}
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run affected tests
run: yarn test:pr:node --base=${{ github.event.pull_request.base.sha }}
if: github.event_name == 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
- name: Run all tests
run: yarn test:ci:node
if: github.event_name != 'pull_request'
env:
NODE_VERSION: ${{ matrix.node }}
job_browser_playwright_tests:
name:
Playwright ${{ matrix.bundle }}${{ matrix.project && matrix.project != 'chromium' && format(' {0}',
matrix.project) || ''}}${{ matrix.shard && format(' ({0}/{1})', matrix.shard, matrix.shards) || ''}} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04-large-js
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
bundle:
- esm
- bundle
- bundle_min
- bundle_logs_metrics
- bundle_replay
- bundle_replay_logs_metrics
- bundle_tracing
- bundle_tracing_logs_metrics
- bundle_tracing_replay
- bundle_tracing_replay_logs_metrics
- bundle_tracing_replay_feedback
- bundle_tracing_replay_feedback_logs_metrics
- bundle_tracing_replay_feedback_logs_metrics_min
project:
- chromium
include:
# Only check all projects for full bundle
# We also shard the tests as they take the longest
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'webkit'
- bundle: bundle_tracing_replay_feedback_logs_metrics_min
project: 'firefox'
- bundle: esm
project: chromium
shard: 1
shards: 4
- bundle: esm
project: chromium
shard: 2
shards: 4
- bundle: esm
project: chromium
shard: 3
shards: 4
- bundle: esm
project: chromium
shard: 4
shards: 4
exclude:
# Do not run the un-sharded esm tests
- bundle: esm
project: 'chromium'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: ${{ matrix.project }}
- name: Run Playwright tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
working-directory: dev-packages/browser-integration-tests
run:
yarn test:all${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard &&
format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name:
playwright-traces-job_browser_playwright_tests-${{ matrix.bundle}}-${{matrix.project}}-${{matrix.shard ||
'0'}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_browser_loader_tests:
name: PW ${{ matrix.bundle }} Tests
needs: [job_get_metadata, job_build, job_build_bundles]
if: needs.job_build.outputs.changed_browser_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
bundle:
- loader_base
- loader_eager
- loader_debug
- loader_tracing
- loader_replay
- loader_replay_buffer
- loader_tracing_replay
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore build bundle artifacts
uses: actions/download-artifact@v8
with:
name: build-bundle-output
path: ${{ env.BUNDLE_ARTIFACT_DOWNLOAD_PATH }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
- name: Run Playwright Loader tests
env:
PW_BUNDLE: ${{ matrix.bundle }}
run: |
cd dev-packages/browser-integration-tests
yarn test:loader
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_browser_loader_tests-${{ matrix.bundle}}
path: dev-packages/browser-integration-tests/test-results
overwrite: true
retention-days: 7
job_check_for_faulty_dts:
name: Check for faulty .d.ts files
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Check for dts files that reference stuff in the temporary build folder
run: |
if grep -r --include "*.d.ts" --exclude-dir ".nx" 'import("@sentry(-internal)?/[^/]*/build' .; then
echo "Found illegal TypeScript import statement."
exit 1
fi
job_node_integration_tests:
name:
Node (${{ matrix.node }})${{ (matrix.typescript && format(' (TS {0})', matrix.typescript)) || '' }}${{
(matrix.use_orchestrion && format(' (Orchestrion)', matrix.use_orchestrion)) || '' }} Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_node_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
typescript:
- false
use_orchestrion:
- false
include:
# Only check typescript for latest version (to streamline CI)
- node: 24
typescript: '5.0'
- node: 20.19
use_orchestrion: 'true'
- node: 22
use_orchestrion: 'true'
- node: 24
use_orchestrion: 'true'
- node: 26
use_orchestrion: 'true'
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Free up disk space if low
# The full suite pulls several DB docker images (mssql alone is ~1.5GB)
# Available disk space is not consistent, if we detect low space this cleans up some unused toolchains
run: |
df -h /
avail_kb=$(df -k --output=avail / | tail -1)
if [ "$avail_kb" -lt $((40 * 1024 * 1024)) ]; then
echo "Low disk space (<40GB free) — reclaiming unused toolchains"
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /opt/hostedtoolcache/CodeQL
df -h /
else
echo "Sufficient disk space — skipping cleanup"
fi
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Overwrite typescript version
if: matrix.typescript == '5.0'
run: node ./scripts/use-ts-5_0.js
working-directory: dev-packages/node-integration-tests
- name: Run integration tests
working-directory: dev-packages/node-integration-tests
run: yarn test
env:
INJECT_ORCHESTRION: ${{ matrix.use_orchestrion }}
job_cloudflare_integration_tests:
name: Cloudflare Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_cloudflare_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/cloudflare-integration-tests
run: yarn test
job_bundler_plugin_integration_tests:
name: Bundler Plugin Integration Tests (Node ${{ matrix.node }})
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bundler_plugin_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
node: [20.19, 22, 24, 26]
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
# The fixtures install the locally-packed `@sentry/bundler-plugins` tarball with pnpm.
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bundler-plugin-integration-tests
run: yarn test
job_bun_integration_tests:
name: Bun Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_bun_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Run integration tests
working-directory: dev-packages/bun-integration-tests
run: yarn test
job_deno_integration_tests:
name: Deno Integration Tests
needs: [job_get_metadata, job_build]
if: needs.job_build.outputs.changed_deno_integration == 'true' || github.event_name != 'pull_request'
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Set up Deno
uses: denoland/setup-deno@v2.0.4
with:
deno-version: 'v2.8.0'
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build @sentry/deno
working-directory: packages/deno
run: yarn build
- name: Run integration tests
working-directory: dev-packages/deno-integration-tests
run: yarn test
job_build_tarballs:
name: Build tarballs
# We want to run this if:
# - The build job was successful, not skipped
if: |
always() &&
needs.job_build.result == 'success'
needs: [job_get_metadata, job_build]
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'package.json'
- name: Restore NX cache
uses: actions/cache/restore@v5
with:
path: |
.nx/cache
.nx/workspace-data
key: ${{ env.NX_CACHE_KEY }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Build tarballs
run: yarn build:tarball
- name: Upload tarball artifacts
uses: actions/upload-artifact@v7
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_GLOB }}
if-no-files-found: error
retention-days: 4
compression-level: 6
overwrite: true
job_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_build_tarballs.result == 'success' && needs.job_build.outputs.e2e-matrix !='{"include":[]}'
needs: [job_get_metadata, job_build, job_build_layer, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
# We just use a dummy DSN here, only send to the tunnel anyhow
E2E_TEST_DSN: 'https://username@domain/123'
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
PUBLIC_E2E_TEST_DSN: 'https://username@domain/123'
REACT_APP_E2E_TEST_DSN: 'https://username@domain/123'
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Bun
if:
contains(fromJSON('["node-exports-test-app","nextjs-16-bun", "elysia-bun", "hono-4", "bun-bytecode",
"bun-mysql"]'), matrix.test-application)
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.3.14'
- name: Set up AWS SAM
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
uses: aws-actions/setup-sam@v2
with:
use-installer: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Deno
if:
matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed' || matrix.test-application ==
'deno-redis'|| matrix.test-application == 'hono-4' || matrix.test-application == 'deno-mysql' ||
matrix.test-application == 'deno-pg'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Restore build layer artifacts
uses: actions/download-artifact@v8
if: matrix.test-application == 'aws-serverless' || matrix.test-application == 'aws-serverless-layer'
with:
name: build-layer-output
path: ${{ env.BUILD_LAYER_PATH }}
- name: Prepare e2e tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate e2e tests setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
env:
SENTRY_E2E_WORKSPACE_ROOT: ${{ github.workspace }}
- name: Upload Playwright Traces
uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-traces-job_e2e_playwright_tests-${{ matrix.test-application}}
path: ${{ runner.temp }}/test-application/test-results
overwrite: true
retention-days: 7
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
# - We skip optional tests on release branches
job_optional_e2e_tests:
name: E2E ${{ matrix.label || matrix.test-application }} Test (optional)
# We only run E2E tests for non-fork PRs because the E2E tests require secrets to work and they can't be accessed from forks
# We need to add the `always()` check here because the previous step has this as well :(
# See: https://github.com/actions/runner/issues/2205
if:
always() && needs.job_get_metadata.outputs.is_release != 'true' && needs.job_build_tarballs.result == 'success' &&
needs.job_build.outputs.e2e-matrix-optional != '{"include":[]}' && (github.event_name != 'pull_request' ||
github.event.pull_request.head.repo.full_name == github.repository) && github.actor != 'dependabot[bot]'
needs: [job_get_metadata, job_build, job_build_tarballs]
runs-on: ubuntu-24.04
timeout-minutes: 15
env:
E2E_TEST_AUTH_TOKEN: ${{ secrets.E2E_TEST_AUTH_TOKEN }}
E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
# Needed because some apps expect a certain prefix
NEXT_PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
PUBLIC_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
REACT_APP_E2E_TEST_DSN: ${{ secrets.E2E_TEST_DSN }}
E2E_TEST_SENTRY_ORG_SLUG: 'sentry-javascript-sdks'
E2E_TEST_SENTRY_PROJECT: 'sentry-javascript-e2e-tests'
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.job_build.outputs.e2e-matrix-optional) }}
steps:
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v7
with:
ref: ${{ env.HEAD_COMMIT }}
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
with:
version: 9.15.9
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version-file: 'dev-packages/e2e-tests/test-applications/${{ matrix.test-application }}/package.json'
- name: Set up Deno
if: matrix.test-application == 'deno' || matrix.test-application == 'deno-streamed'
uses: denoland/setup-deno@v2.0.4
with:
deno-version: ${{ matrix.deno-version || 'v2.8.0' }}
- name: Restore caches
uses: ./.github/actions/restore-cache
with:
dependency_cache_key: ${{ needs.job_build.outputs.dependency_cache_key }}
- name: Restore tarball artifacts
uses: actions/download-artifact@v8
with:
name: build-tarball-output
path: ${{ env.TARBALL_ARTIFACT_DOWNLOAD_PATH }}
- name: Prepare E2E tests
run: yarn test:prepare
working-directory: dev-packages/e2e-tests
- name: Validate test setup
run: yarn test:validate
working-directory: dev-packages/e2e-tests
- name: Copy to temp
run: yarn ci:copy-to-temp ./test-applications/${{ matrix.test-application }} ${{ runner.temp }}/test-application
working-directory: dev-packages/e2e-tests
- name: Add pnpm overrides
run:
yarn ci:pnpm-overrides ${{ runner.temp }}/test-application ${{ github.workspace
}}/dev-packages/e2e-tests/packed
working-directory: dev-packages/e2e-tests
- name: Build E2E app
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 7
run: ${{ matrix.build-command || 'pnpm test:build' }}
- name: Install Playwright
uses: ./.github/actions/install-playwright
with:
browsers: chromium
cwd: ${{ runner.temp }}/test-application
- name: Run E2E test
working-directory: ${{ runner.temp }}/test-application
timeout-minutes: 10
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
- name: Pre-process E2E Test Dumps
if: failure()
run: |
node ./scripts/normalize-e2e-test-dump-transaction-events.js
- name: Upload E2E Test Event Dumps
uses: actions/upload-artifact@v7
if: failure()
with:
name: E2E Test Dump (${{ matrix.label || matrix.test-application }})
path: ${{ runner.temp }}/test-application/event-dumps
overwrite: true
retention-days: 7
if-no-files-found: ignore
job_required_jobs_passed:
name: All required jobs passed or were skipped
needs:
[
job_build,
job_build_bundles,
job_build_layer,
job_build_tarballs,
job_browser_unit_tests,
job_bun_unit_tests,
job_deno_unit_tests,
job_node_unit_tests,
job_node_integration_tests,
job_cloudflare_integration_tests,
job_bundler_plugin_integration_tests,
job_bun_integration_tests,
job_deno_integration_tests,
job_browser_playwright_tests,
job_browser_loader_tests,
job_e2e_tests,
job_artifacts,
job_lint,
job_check_lockfile,
job_check_format,
job_circular_dep_check,
job_size_check,
]
# Always run this, even if a dependent job failed
if: always()
runs-on: ubuntu-24.04
permissions:
issues: write
checks: read
steps:
- name: Check out current commit
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/checkout@v7
with:
sparse-checkout: |
.github
scripts
- name: Create issues for failed jobs
if: github.ref == 'refs/heads/develop' && contains(needs.*.result, 'failure')
uses: actions/github-script@v9
with:
script: |
const { default: run } = await import(
`${process.env.GITHUB_WORKSPACE}/scripts/report-ci-failures.mjs`
);
await run({ github, context, core });
- name: Check for failures
if: cancelled() || contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: |
echo "One of the dependent jobs have failed. You may need to re-run it." && exit 1