1212 - main
1313 - " maintenance/**"
1414 workflow_dispatch :
15+ workflow_call :
16+ inputs :
17+ astroid_sha :
18+ required : true
19+ type : string
1520
1621env :
1722 CACHE_VERSION : 5
4752 - &checkout
4853 name : Check out code from GitHub
495455+ with :
56+ repository : ${{ github.repository }}
5057 - &setup-python
5158 name : Set up Python ${{ matrix.python-version }}
5259 id : python
5966 id : generate-python-key
6067 run : >-
6168 echo "key=${{ env.KEY_PREFIX }}-${{ env.CACHE_VERSION }}-${{
69+ inputs.astroid_sha }}-${{
6270 hashFiles('pyproject.toml', 'requirements_test.txt',
6371 'requirements_test_min.txt', 'requirements_test_pre_commit.txt') }}" >>
6472 $GITHUB_OUTPUT
7886 . venv/bin/activate
7987 python -m pip install --upgrade pip
8088 pip install --upgrade --requirement requirements_test.txt
89+ - name : Install requested astroid SHA
90+ if : inputs.astroid_sha != ''
91+ run : |
92+ . venv/bin/activate
93+ pip install --force-reinstall --no-deps git+https://github.com/${{ github.repository_owner }}/astroid@${{ inputs.astroid_sha }}
8194 - name : Run pytest
8295 run : |
8396 . venv/bin/activate
@@ -190,6 +203,7 @@ jobs:
190203 id : generate-python-key
191204 run : >-
192205 echo "key=venv-${{ env.CACHE_VERSION }}-${{
206+ inputs.astroid_sha }}-${{
193207 hashFiles('pyproject.toml', 'requirements_test_min.txt')
194208 }}" >> $env:GITHUB_OUTPUT
195209 - *cache-python
@@ -200,6 +214,11 @@ jobs:
200214 . venv\\Scripts\\activate
201215 python -m pip install --upgrade pip
202216 pip install --upgrade --requirement requirements_test_min.txt
217+ - name : Install requested astroid SHA
218+ if : inputs.astroid_sha != ''
219+ run : |
220+ . venv\\Scripts\\activate
221+ pip install --force-reinstall --no-deps git+https://github.com/${{ github.repository_owner }}/astroid@${{ inputs.astroid_sha }}
203222 - name : Run pytest
204223 run : |
205224 . venv\\Scripts\\activate
0 commit comments