Skip to content

feat: implement @platformatic/flame CPU profiling package #1

feat: implement @platformatic/flame CPU profiling package

feat: implement @platformatic/flame CPU profiling package #1

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Upload coverage reports
if: matrix.node-version == '20.x'
uses: codecov/codecov-action@v3
continue-on-error: true
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run linting
run: npm run lint
build:
name: Build & Package
runs-on: ubuntu-latest
needs: [test, lint]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Verify package contents
run: |
npm pack --dry-run
echo "Package size:"
npm pack --silent | xargs ls -lh
- name: Test CLI installation
run: |
npm pack
npm install -g *.tgz
flame --help
- name: Upload package artifact
uses: actions/upload-artifact@v3
with:
name: npm-package
path: '*.tgz'
retention-days: 7
integration:
name: Integration Tests
runs-on: ubuntu-latest
needs: [test, lint]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run integration tests
run: npm run test -- test/integration.test.js
- name: Test examples
run: |
timeout 30s node examples/load-test-server.js &
SERVER_PID=$!
sleep 5
node examples/run-load-test.js
kill $SERVER_PID || true