mirror of
https://github.com/deepset-ai/haystack.git
synced 2026-01-06 12:07:04 +00:00
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:
parent
ec85207cf7
commit
44934839a7
13
.github/actions/python_cache/action.yml
vendored
13
.github/actions/python_cache/action.yml
vendored
@ -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/
|
||||
|
||||
20
.github/workflows/tests.yml
vendored
20
.github/workflows/tests.yml
vendored
@ -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:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user