Skip to content

Commit e7d9768

Browse files
Enable running pylint test suite with custom astroid SHA (#10841)
1 parent 67b2d49 commit e7d9768

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ on:
1212
- main
1313
- "maintenance/**"
1414
workflow_dispatch:
15+
workflow_call:
16+
inputs:
17+
astroid_sha:
18+
required: true
19+
type: string
1520

1621
env:
1722
CACHE_VERSION: 5
@@ -47,6 +52,8 @@ jobs:
4752
- &checkout
4853
name: Check out code from GitHub
4954
uses: actions/[email protected]
55+
with:
56+
repository: ${{ github.repository }}
5057
- &setup-python
5158
name: Set up Python ${{ matrix.python-version }}
5259
id: python
@@ -59,6 +66,7 @@ jobs:
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
@@ -78,6 +86,11 @@ jobs:
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

Comments
 (0)