forked from elastic/elastic-otel-python-instrumentations
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (75 loc) · 2.45 KB
/
Copy pathci.yml
File metadata and controls
81 lines (75 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: ci
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/env-install
- uses: pre-commit/action@v3.0.1
license-header-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: ./scripts/license_headers_check.sh
pip-installable:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
working-dir: ['instrumentation/elastic-opentelemetry-instrumentation-openai']
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/env-install
- run: pip install .
working-directory: ${{ matrix.working-dir }}
test:
runs-on: ubuntu-latest
env:
py38: "3.8"
py39: "3.9"
py310: "3.10"
py311: "3.11"
py312: "3.12"
py313: "3.13"
# Baseline version of openai client we support
baseline: "1.2.0"
latest: ""
working_dir: "instrumentation/elastic-opentelemetry-instrumentation-openai"
strategy:
fail-fast: false
matrix:
python-version: [py38, py39, py310, py311, py312, py313]
openai-version: [baseline, latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ env[matrix.python-version] }}
uses: actions/setup-python@v5
with:
python-version: ${{ env[matrix.python-version] }}
architecture: "x64"
- if: ${{ env[matrix.python-version] == '3.8' || env[matrix.python-version] == '3.9' }}
run: pip install -r dev-requirements-3.9.txt
working-directory: ${{ env.working_dir }}
- if: ${{ env[matrix.python-version] != '3.8' && env[matrix.python-version] != '3.9' }}
run: pip install -r dev-requirements.txt
working-directory: ${{ env.working_dir }}
- if: ${{ env[matrix.openai-version] }}
name: update openai to required version if not latest
run:
pip install openai==${{ env[matrix.openai-version] }}
working-directory: ${{ env.working_dir }}
- run: pytest
working-directory: ${{ env.working_dir }}
- if: ${{ env[matrix.python-version] == '3.13' && !env[matrix.openai-version] && env.OPENAI_API_KEY != '' }}
# Only run on latest python and openai client version because we are calling openai
run: pytest --integration-tests
working-directory: ${{ env.working_dir }}
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}