Skip to content

Commit

Permalink
ci: Remove mypy deps install step in python_cache action (#3956)
Browse files Browse the repository at this point in the history
* Remove mypy deps install step in python_cache action

* Remove step caching mypy dependencies

* Add ignore files in changed files retrieval step
  • Loading branch information
silvanocerza authored and ZanSara committed Jan 27, 2023
1 parent eaac6b9 commit ff63831
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 26 deletions.
13 changes: 0 additions & 13 deletions .github/actions/python_cache/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand All @@ -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 changes: 7 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand All @@ -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:
Expand Down

0 comments on commit ff63831

Please sign in to comment.