name: lint on: workflow_call: inputs: working-directory: required: true type: string description: "From which folder this pipeline executes" env: POETRY_VERSION: "1.4.2" jobs: build: runs-on: ubuntu-latest strategy: matrix: python-version: - "3.8" - "3.9" - "3.10" - "3.11" steps: - uses: actions/checkout@v3 - uses: actions/cache@v3 id: cache-pip name: Cache langchain editable pip install - ${{ matrix.python-version }} env: SEGMENT_DOWNLOAD_TIMEOUT_MIN: "15" with: path: | ~/.cache/pip key: pip-editable-langchain-deps-${{ runner.os }}-${{ runner.arch }}-py-${{ matrix.python-version }} - name: Install poetry run: | pipx install poetry==$POETRY_VERSION - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 env: SEGMENT_DOWNLOAD_TIMEOUT_MIN: "15" with: python-version: ${{ matrix.python-version }} cache: poetry 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