Skip to content
Merged
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
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,41 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Configure Poetry for CI optimization
run: |
poetry config virtualenvs.create false
poetry config virtualenvs.in-project false

- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-

- uses: actions/setup-node@v4
with:
node-version: 18

- name: Cache Nx
uses: actions/cache@v4
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ hashFiles('nx.json', 'package-lock.json') }}
restore-keys: |
nx-${{ runner.os }}-

- uses: nrwl/nx-set-shas@v4
- run: npm ci
- run: npx nx affected -t install --with dev
- run: npx nx affected -t lint --parallel=3

- name: Clean up build artifacts
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing if: always() may prevent cleanup from running on failure, leaving artifacts that can increase disk usage.

run: |
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -exec rm -rf {} + || true

build-packages:
name: Build Packages
runs-on: ubuntu-latest
Expand All @@ -66,10 +92,32 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Configure Poetry for CI optimization
run: |
poetry config virtualenvs.create false
poetry config virtualenvs.in-project false

- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-${{ matrix.python-version }}-
poetry-${{ runner.os }}-

- uses: actions/setup-node@v4
with:
node-version: 18

- name: Cache Nx
uses: actions/cache@v4
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ hashFiles('nx.json', 'package-lock.json') }}
restore-keys: |
nx-${{ runner.os }}-

- uses: nrwl/nx-set-shas@v4

- run: npm ci
Expand All @@ -80,6 +128,11 @@ jobs:
- name: Build
run: npx nx affected -t build-release --parallel=3

- name: Clean up build artifacts
run: |
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -exec rm -rf {} + || true

test-packages:
name: Test Packages
runs-on: ubuntu-latest
Expand All @@ -104,10 +157,40 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Configure Poetry for CI optimization
run: |
poetry config virtualenvs.create false
poetry config virtualenvs.in-project false

- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-${{ matrix.python-version }}-
poetry-${{ runner.os }}-

- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: pip-${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
pip-${{ runner.os }}-${{ matrix.python-version }}-

- uses: actions/setup-node@v4
with:
node-version: 18

- name: Cache Nx
uses: actions/cache@v4
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ hashFiles('nx.json', 'package-lock.json') }}
restore-keys: |
nx-${{ runner.os }}-

- uses: nrwl/nx-set-shas@v4

- run: npm ci
Expand All @@ -119,3 +202,8 @@ jobs:
env:
HAYSTACK_TELEMETRY_ENABLED: False
run: npx nx affected -t test --exclude='sample-app' --exclude='opentelemetry-instrumentation-haystack' --parallel=3

- name: Clean up build artifacts
run: |
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -exec rm -rf {} + || true
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,41 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Configure Poetry for CI optimization
run: |
poetry config virtualenvs.create false
poetry config virtualenvs.in-project false

- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-

- uses: actions/setup-node@v4
with:
node-version: 18

- name: Cache Nx
uses: actions/cache@v4
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ hashFiles('nx.json', 'package-lock.json') }}
restore-keys: |
nx-${{ runner.os }}-

- run: npm ci

- name: Build Instrumentations
run: npx nx run-many -t build-release --projects=tag:instrumentation

- name: Clean up build artifacts
run: |
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -exec rm -rf {} + || true

- run: mkdir instrumentations-dist
- run: cp packages/opentelemetry-instrumentation-*/dist/* instrumentations-dist

Expand Down Expand Up @@ -101,15 +127,41 @@ jobs:
- name: Install Poetry
uses: snok/install-poetry@v1

- name: Configure Poetry for CI optimization
run: |
poetry config virtualenvs.create false
poetry config virtualenvs.in-project false

- name: Cache Poetry dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry
key: poetry-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ runner.os }}-

- uses: actions/setup-node@v4
with:
node-version: 18

- name: Cache Nx
uses: actions/cache@v4
with:
path: .nx/cache
key: nx-${{ runner.os }}-${{ hashFiles('nx.json', 'package-lock.json') }}
restore-keys: |
nx-${{ runner.os }}-

- run: npm ci

- name: Build Traceloop SDK
run: npx nx run traceloop-sdk:build-release

- name: Clean up build artifacts
run: |
find . -name "*.pyc" -delete
find . -name "__pycache__" -type d -exec rm -rf {} + || true

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down