Repository navigation
Expand file tree
/
Copy pathpython-agent-framework-compatibility.yml
More file actions
136 lines (130 loc) · 4.75 KB
/
Copy pathpython-agent-framework-compatibility.yml
File metadata and controls
136 lines (130 loc) · 4.75 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Python Agent Framework compatibility
on:
pull_request:
paths:
- "python/**"
- "scripts/scan_credentials.py"
- ".github/workflows/python-agent-framework-compatibility.yml"
push:
branches:
- main
- build/python-packaging-release
paths:
- "python/**"
- "scripts/scan_credentials.py"
- ".github/workflows/python-agent-framework-compatibility.yml"
schedule:
- cron: "17 8 * * 1"
workflow_dispatch:
inputs:
include_preview:
description: "Also test the latest non-yanked preview, when one exists"
required: true
default: true
type: boolean
exact_version:
description: "Optional exact non-yanked agent-framework-core PEP 440 version"
required: false
type: string
permissions:
contents: read
concurrency:
group: python-framework-compatibility-${{ github.ref }}
cancel-in-progress: true
jobs:
resolve:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
matrix: ${{ steps.versions.outputs.matrix }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # actions/checkout v4.4.0
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # actions/setup-python v5
with:
python-version: "3.10"
- name: Install ecosystem version parser
run: python -m pip install --disable-pip-version-check "packaging>=24,<26"
- name: Resolve versions from official PyPI metadata
id: versions
working-directory: python
env:
INCLUDE_PREVIEW: ${{ github.event_name == 'workflow_dispatch' && inputs.include_preview }}
EXACT_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.exact_version || '' }}
run: |
arguments=()
if [ "$INCLUDE_PREVIEW" = "true" ]; then
arguments+=(--include-preview)
fi
if [ -n "$EXACT_VERSION" ]; then
arguments+=(--exact "$EXACT_VERSION")
fi
python scripts/resolve_framework_versions.py "${arguments[@]}" \
--json-output compatibility-reports/resolution.json \
--markdown-output compatibility-reports/resolution.md
cat compatibility-reports/resolution.md >> "$GITHUB_STEP_SUMMARY"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # actions/upload-artifact v4.6.2
with:
name: python-framework-version-resolution
path: python/compatibility-reports/
if-no-files-found: error
retention-days: 30
compatibility:
needs: resolve
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.resolve.outputs.matrix) }}
runs-on: ubuntu-latest
timeout-minutes: 35
defaults:
run:
working-directory: python
env:
FRAMEWORK_VERSION: ${{ matrix.version }}
REPORT_DIR: compatibility-reports/${{ matrix.label }}-${{ matrix.version }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # actions/checkout v4.4.0
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # actions/setup-python v5
with:
python-version: "3.10"
cache: pip
cache-dependency-path: python/pyproject.toml
- name: Run isolated compatibility gate
id: gate
continue-on-error: true
run: |
python scripts/run_framework_compatibility.py \
--version "$FRAMEWORK_VERSION" \
--label "${{ matrix.label }}" \
--channel "${{ matrix.channel }}" \
--report-dir "$REPORT_DIR"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # actions/upload-artifact v4.6.2
if: always()
with:
name: python-framework-${{ matrix.label }}-${{ matrix.version }}
path: python/compatibility-reports/${{ matrix.label }}-${{ matrix.version }}/
if-no-files-found: error
retention-days: 30
- name: Enforce compatibility outcome after retaining evidence
if: always()
env:
GATE_OUTCOME: ${{ steps.gate.outcome }}
run: |
cat "$REPORT_DIR/summary.md" >> "$GITHUB_STEP_SUMMARY"
test "$GATE_OUTCOME" = success
compatibility-readiness:
needs: [resolve, compatibility]
if: always()
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Enforce complete stable compatibility matrix
env:
RESOLVE_RESULT: ${{ needs.resolve.result }}
COMPATIBILITY_RESULT: ${{ needs.compatibility.result }}
run: |
test "$RESOLVE_RESULT" = success
test "$COMPATIBILITY_RESULT" = success