3535 security-cache-hit : ${{ steps.security.outputs.cache-hit && !inputs.skip_cache }}
3636 analysis-cache-hit : ${{ steps.analysis.outputs.cache-hit && !inputs.skip_cache }}
3737 build-cache-hit : ${{ steps.build.outputs.cache-hit && !inputs.skip_cache }}
38+ py_vers_current : ${{ steps.config.outputs.py_vers_current }}
39+ py_vers_lesser : ${{ steps.config.outputs.py_vers_lesser }}
40+ py_vers_min : ${{ steps.config.outputs.py_vers_min }}
41+ py_vers_max : ${{ steps.config.outputs.py_vers_max }}
3842 steps :
3943 - name : Lookup test result cache
4044 uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
@@ -91,16 +95,71 @@ jobs:
9195 echo "fully_cached=${{ steps.tests.outputs.cache-hit && steps.security.outputs.cache-hit && steps.analysis.outputs.cache-hit }}" >> $GITHUB_OUTPUT
9296
9397 - name : Checkout codebase
94- if : ${{ !steps.cache.outputs.fully_cached || inputs.skip_cache }}
9598 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
9699
97100 # Cache warmup for parallel dependent jobs
98101 - name : Prepare the Python environment
99102 if : ${{ !steps.cache.outputs.fully_cached || inputs.skip_cache }}
100103 uses : ./.github/actions/prepare
104+ with :
105+ skip_cache_restore : true
106+
107+ # Get configuration info, this step must not depend on anything from the prepare action
108+ - name : Get configuration info
109+ id : config
110+ shell : bash
111+ run : |
112+ # Resolve the Python versions supported by the project:
113+ python3 utils/pyvers.py >> $GITHUB_OUTPUT
114+
115+ compatibility :
116+ name : Compatibility Tests on Python ${{ matrix.python_version }}
117+ runs-on : ubuntu-24.04
118+ needs : prebuild
119+ concurrency :
120+ group : compatibility-${{ matrix.python_version }}-${{ github.sha }}
121+ env :
122+ CI : true
123+ strategy :
124+ # max-parallel: 1
125+ matrix :
126+ python_version : ${{ fromJSON(needs.prebuild.outputs.py_vers_lesser) }}
127+ include :
128+ - python_version : ${{ needs.prebuild.outputs.py_vers_min }}-lowest_deps
129+ steps :
130+ - name : Fetch compatibility result cache
131+ uses : actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
132+ id : compat
133+ with :
134+ lookup-only : true
135+ path : ./reports/compatibility/${{ matrix.python_version }}
136+ key : compatibility-${{ matrix.python_version }}-${{ github.sha }}
137+
138+ - name : Report on cache
139+ if : ${{ steps.compat.outputs.cache-hit == 'true' && !inputs.skip_cache }}
140+ run : |
141+ echo "::notice::Skipping compatibility test for Python ${{ matrix.python_version }} due to cached result for this commit."
142+
143+ - name : Checkout codebase
144+ if : ${{ steps.compat.outputs.cache-hit != 'true' || inputs.skip_cache }}
145+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
146+
147+ - name : Run compatibility test
148+ if : ${{ steps.compat.outputs.cache-hit != 'true' || inputs.skip_cache }}
149+ uses : ./.github/actions/tests
150+ with :
151+ python_version : ${{ matrix.python_version }}
152+ full : false
101153
154+ - name : Save compatibility result cache
155+ if : ${{ steps.compat.outputs.cache-hit != 'true' || inputs.skip_cache }}
156+ uses : actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
157+ with :
158+ path : ./reports/compatibility/${{ matrix.python_version }}
159+ key : compatibility-${{ matrix.python_version }}-${{ github.sha }}
160+
102161 tests :
103- name : Functional Tests
162+ name : Functional Tests on Python ${{ needs.prebuild.outputs.py_vers_max }}
104163 runs-on : ubuntu-24.04
105164 needs : prebuild
106165 if : ${{ needs.prebuild.outputs.tests-cache-hit != 'true' }}
@@ -125,22 +184,14 @@ jobs:
125184 if : ${{ !steps.tests.outputs.cache-hit }}
126185 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
127186
128- - name : Prepare the Python environment
187+ - name : Run the tests
129188 if : ${{ !steps.tests.outputs.cache-hit }}
130- uses : ./.github/actions/prepare
131-
132- - name : Run unit tests
133- if : ${{ !steps.tests.outputs.cache-hit && github.event_name == 'pull_request'}}
134- shell : bash
135- run : pytest --cov-report lcov:./reports/tests/coverage.lcov
136-
137- # For security and cost reasons, don't run integration tests on PRs
138- - name : Run unit and integration tests
139- if : ${{ !steps.tests.outputs.cache-hit && github.event_name != 'pull_request' }}
140- shell : bash
189+ uses : ./.github/actions/tests
141190 env :
142191 OPENAI_API_KEY : ${{ secrets.OPENAI_API_KEY }}
143- run : pytest --cov-report lcov:./reports/tests/coverage.lcov --plus_integration
192+ with :
193+ python_version : ${{ needs.prebuild.outputs.py_vers_max }}
194+ full : true
144195
145196 security :
146197 name : Security Checks
@@ -233,7 +284,7 @@ jobs:
233284 build :
234285 name : Build Package
235286 runs-on : ubuntu-24.04
236- needs : [prebuild, tests, security, analysis]
287+ needs : [prebuild, tests, compatibility, security, analysis]
237288 if : ${{ !failure() && !cancelled() && needs.prebuild.outputs.build-cache-hit != 'true' && needs.prebuild.result != 'skipped' }}
238289 concurrency :
239290 group : build-${{ github.sha }}
0 commit comments