From ff63831dd8e408a642b17cdd60ea5a826fc1917d Mon Sep 17 00:00:00 2001 From: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com> Date: Thu, 26 Jan 2023 14:17:34 +0100 Subject: [PATCH] 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 --- .github/actions/python_cache/action.yml | 13 ------------- .github/workflows/tests.yml | 20 +++++++------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/.github/actions/python_cache/action.yml b/.github/actions/python_cache/action.yml index 485d045ea2..8daeff39f2 100644 --- a/.github/actions/python_cache/action.yml +++ b/.github/actions/python_cache/action.yml @@ -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/ diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 83d3601673..b85da6f98a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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: