-
Notifications
You must be signed in to change notification settings - Fork 41
56 lines (53 loc) · 1.71 KB
/
python-CI.yaml
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
name: Python CI
on:
push:
branches: [ main ]
pull_request:
paths:
- "python/**"
defaults:
run:
working-directory: ./python
jobs:
ci:
name: CI Python
runs-on: oss-4-core-runner
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: filter
with:
working-directory: python
list-files: json
filters: |
diff:
- "python/**/*.py"
- "python/**/*.toml"
- run: >-
echo "packages=$(echo '${{ steps.filter.outputs.diff_files }}'
| jq -r '.[]'
| sed -n
-e 's/^python\/instrumentation\/openinference-instrumentation-\([^/]*\)\/.*/\1/p'
-e 's/^python\/openinference-\(instrumentation\)\/.*/\1/p'
-e 's/^python\/openinference-\(semantic-conventions\)\/.*/\1/p'
| sort -u
| sed -e 's/semantic-conventions/semconv/' -e 's/-/_/' -e 's/^/\\b/'
| paste -sd "|" -)"
>> "$GITHUB_OUTPUT"
if: ${{ steps.filter.outputs.diff == 'true' }}
id: changes
- uses: actions/setup-python@v5
if: ${{ (steps.filter.outputs.diff == 'true') && (steps.changes.outputs.packages != '') }}
with:
python-version: |
3.8
3.9
3.10
3.11
3.12
- run: pip install tox-uv==1.11.2
if: ${{ (steps.filter.outputs.diff == 'true') && (steps.changes.outputs.packages != '') }}
- run: >-
tox run-parallel --parallel-no-spinner
-e $(tox -l | egrep -e '${{ steps.changes.outputs.packages }}' | paste -sd, -)
if: ${{ (steps.filter.outputs.diff == 'true') && (steps.changes.outputs.packages != '') }}