Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Integration

on:
push:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'LICENSE'
- '.editorconfig'
branches:
- main
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
- 'LICENSE'
- '.editorconfig'
branches:
- main

permissions:
contents: read

jobs:
smoke:
runs-on: ubuntu-x64-small
strategy:
fail-fast: false
matrix:
node: [20, 22, 24, 25]

steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: 'false'

- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: grafana/pyroscope-sdk-smoke-action
path: .github/actions/pyroscope-sdk-smoke-action
persist-credentials: 'false'

- name: Set node version in Dockerfile
run: sed -i 's/^ARG NODE_VERSION=.*/ARG NODE_VERSION=${{ matrix.node }}/' smoke/Dockerfile

- uses: ./.github/actions/pyroscope-sdk-smoke-action
with:
dockerfile: smoke/Dockerfile
service-name: smoke
search-term: smokeWork
profile-type: process_cpu:wall:nanoseconds:wall:nanoseconds
timeout-seconds: '90'
22 changes: 22 additions & 0 deletions smoke/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
ARG NODE_VERSION=lts
FROM node:${NODE_VERSION}-alpine

RUN apk add --no-cache python3 make g++

WORKDIR /sdk

COPY package.json yarn.lock .yarnrc.yml ./
RUN corepack enable && yarn install --immutable

COPY tsconfig.json ./
COPY config/ ./config/
COPY src/ ./src/
COPY tools/ ./tools/
RUN yarn build && yarn pack --out /tmp/pyroscope-nodejs.tgz

WORKDIR /app
RUN npm init -y && npm install /tmp/pyroscope-nodejs.tgz

COPY smoke/app.mjs ./

CMD ["node", "app.mjs"]
26 changes: 26 additions & 0 deletions smoke/app.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { init, start } from '@pyroscope/nodejs';

function smokeWork(n) {
const primes = [];
let candidate = 2;
while (primes.length < n) {
const isPrime = !primes.some((p) => candidate % p === 0);
if (isPrime) primes.push(candidate);
candidate++;
}
return primes;
}

const N = 10_000_000;

init({
serverAddress: process.env.PYROSCOPE_SERVER_ADDRESS,
appName: 'smoke',
flushIntervalMs: 5000,
wall: {
samplingDurationMs: 5000,
},
});
start();

smokeWork(N);
Loading