ci: Remove mypy deps install step in python_cache action (#3956)

* Remove mypy deps install step in python_cache action

* Remove step caching mypy dependencies

* Add ignore files in changed files retrieval step
This commit is contained in:
Silvano Cerza 2023-01-26 14:17:34 +01:00 committed by GitHub
parent ec85207cf7
commit 44934839a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 26 deletions

View File

@ -41,14 +41,6 @@ runs:
# The cache will be rebuild every day and at every change of the dependency files
key: ${{ inputs.prefix }}-py${{ inputs.pythonVersion }}-${{ env.date }}-${{ hashFiles('**/pyproject.toml') }}
- name: Cache Mypy path
id: cache-mypy
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}/.mypy_cache
# The cache will be rebuild every day and at every change of the dependency files
key: mypy-${{ inputs.prefix }}-py${{ inputs.pythonVersion }}-${{ env.date }}-${{ hashFiles('**/pyproject.toml') }}
- name: Install dependencies
# NOTE: this action runs only on cache miss to refresh the dependencies and make sure the next Haystack install will be faster.
# Do not rely on this step to install Haystack itself!
@ -60,8 +52,3 @@ runs:
python -m pip install --upgrade pip
pip install .[all]
pip install rest_api/
- name: Install mypy dependencies
shell: bash
if: inputs.pythonVersion != 3.7
run: python -m mypy --install-types --non-interactive --cache-dir=${{ env.pythonLocation }}/.mypy_cache/ haystack/ rest_api/ --exclude=rest_api/build/ --exclude=rest_api/test/

View File

@ -87,18 +87,12 @@ jobs:
- name: Get changed files
id: files
uses: tj-actions/changed-files@v34
- name: Filter changed files
id: python-files
run: |
for file in ${{ steps.files.outputs.all_changed_files }}; do
if [[ $file == *.py ]]; then
if [[ $file != test/* ]]; then
changed_files="$changed_files $file"
fi
fi
done
echo "changed_files=$changed_files" >> $GITHUB_OUTPUT
with:
files: |
*.py
files_ignore: |
test/**
rest_api/test/**
- name: Setup Python
uses: ./.github/actions/python_cache/
@ -109,7 +103,7 @@ jobs:
if: steps.python-files.outputs.changed_files
run: |
mkdir .mypy_cache/
mypy ${{ steps.python-files.outputs.changed_files }}
mypy --install-types --non-interactive ${{ steps.python-files.outputs.changed_files }} --exclude=rest_api/build/ --exclude=rest_api/test/
- uses: act10ns/slack@v1
with: