mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-17 18:23:59 +00:00
Cache .mypy_cache across lint runs. (#9405)
Preserve the `.mypy_cache` directory across lint runs, to avoid having to re-parse all dependencies and their type information. Approximately a 1min perf win for CI. Before:  After: 
This commit is contained in:
parent
019aa04b06
commit
8f2d321dd0
16
.github/workflows/_lint.yml
vendored
16
.github/workflows/_lint.yml
vendored
@ -13,9 +13,6 @@ env:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
defaults:
|
|
||||||
run:
|
|
||||||
working-directory: ${{ inputs.working-directory }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -48,12 +45,25 @@ jobs:
|
|||||||
cache-dependency-path: |
|
cache-dependency-path: |
|
||||||
${{ inputs.working-directory == '' && '.' || inputs.working-directory }}/**/poetry.lock
|
${{ inputs.working-directory == '' && '.' || inputs.working-directory }}/**/poetry.lock
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
working-directory: ${{ inputs.working-directory }}
|
||||||
run: |
|
run: |
|
||||||
poetry install
|
poetry install
|
||||||
- name: Install langchain editable
|
- name: Install langchain editable
|
||||||
|
working-directory: ${{ inputs.working-directory }}
|
||||||
if: ${{ inputs.working-directory != 'langchain' }}
|
if: ${{ inputs.working-directory != 'langchain' }}
|
||||||
run: |
|
run: |
|
||||||
pip install -e ../langchain
|
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
|
- name: Analysing the code with our lint
|
||||||
|
working-directory: ${{ inputs.working-directory }}
|
||||||
run: |
|
run: |
|
||||||
make lint
|
make lint
|
||||||
|
Loading…
Reference in New Issue
Block a user