Skip to content

The agent engineering platform.

Cache .mypy_cache across lint runs. (#9405)

Predrag Gruevski8f2d321dd0b6
diff --git a/.github/workflows/_lint.yml b/.github/workflows/_lint.yml
index 5fe830959b..b99cd79eb2 100644
--- a/.github/workflows/_lint.yml
+++ b/.github/workflows/_lint.yml
@@ -13,9 +13,6 @@ env:
jobs:
build:
- defaults:
- run:
- working-directory: ${{ inputs.working-directory }}
runs-on: ubuntu-latest
strategy:
matrix:
@@ -48,12 +45,25 @@ jobs:
cache-dependency-path: |
${{ inputs.working-directory == '' && '.' || inputs.working-directory }}/**/poetry.lock
- name: Install dependencies
+ working-directory: ${{ inputs.working-directory }}
run: |
poetry install
- name: Install langchain editable
+ working-directory: ${{ inputs.working-directory }}
if: ${{ inputs.working-directory != 'langchain' }}
run: |
pip install -e ../langchain
+ - name: Get .mypy_cache to speed up mypy
+ uses: actions/cache@v3
+ env:
+ SEGMENT_DOWNLOAD_TIMEOUT_MIN: "15"
+ WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }}
+ with:
+ path: |
+ ${{ env.WORKDIR }}/.mypy_cache
+ key: mypy-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', env.WORKDIR)) }}
+
- name: Analysing the code with our lint
+ working-directory: ${{ inputs.working-directory }}
run: |
make lint