fix sdk call #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: lint | ||
on: | ||
workflow_call: | ||
inputs: | ||
working-directory: | ||
required: true | ||
type: string | ||
description: "From which folder this pipeline executes" | ||
env: | ||
POETRY_VERSION: "1.8.3" | ||
WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }} | ||
# This env var allows us to get inline annotations when ruff has complaints. | ||
RUFF_OUTPUT_FORMAT: github | ||
jobs: | ||
build: | ||
name: "make lint #${{ matrix.python-version }}" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
# Only lint on the min and max supported Python versions. | ||
# It's extremely unlikely that there's a lint issue on any version in between | ||
# that doesn't show up on the min or max versions. | ||
# | ||
# GitHub rate-limits how many jobs can be running at any one time. | ||
# Starting new jobs is also relatively slow, | ||
# so linting on fewer versions makes CI faster. | ||
python-version: | ||
- "3.9" | ||
- "3.12" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
<<<<<<< HEAD | ||
- name: Check Available Disk Space | ||
======= | ||
- name: Check disk space | ||
>>>>>>> 2fa48a1 (WIP) | ||
run: df -h | ||
- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} | ||
uses: "./.github/actions/poetry_setup" | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
poetry-version: ${{ env.POETRY_VERSION }} | ||
working-directory: ${{ inputs.working-directory }} | ||
cache-key: lint-with-extras | ||
- name: Check disk space | ||
run: df -h | ||
- name: Check Poetry File | ||
shell: bash | ||
working-directory: ${{ inputs.working-directory }} | ||
run: | | ||
poetry check | ||
- name: Check lock file | ||
shell: bash | ||
working-directory: ${{ inputs.working-directory }} | ||
run: | | ||
poetry check --lock | ||
- name: Install dependencies | ||
# Also installs dev/lint/test/typing dependencies, to ensure we have | ||
# type hints for as many of our libraries as possible. | ||
# This helps catch errors that require dependencies to be spotted, for example: | ||
# https://github.com/langchain-ai/langchain/pull/10249/files#diff-935185cd488d015f026dcd9e19616ff62863e8cde8c0bee70318d3ccbca98341 | ||
# | ||
# If you change this configuration, make sure to change the `cache-key` | ||
# in the `poetry_setup` action above to stop using the old cache. | ||
# It doesn't matter how you change it, any change will cause a cache-bust. | ||
working-directory: ${{ inputs.working-directory }} | ||
run: | | ||
poetry install --with lint,typing | ||
- name: Check disk space | ||
run: df -h | ||
- name: Get .mypy_cache to speed up mypy | ||
uses: actions/cache@v4 | ||
env: | ||
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "2" | ||
with: | ||
path: | | ||
${{ env.WORKDIR }}/.mypy_cache | ||
key: mypy-lint-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }} | ||
restore-keys: mypy-lint-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}- | ||
- name: Analysing the code with our lint | ||
working-directory: ${{ inputs.working-directory }} | ||
run: | | ||
make lint_package | ||
- name: Install unit+integration test dependencies | ||
working-directory: ${{ inputs.working-directory }} | ||
run: | | ||
poetry install --with test,test_integration | ||
- name: Get .mypy_cache_test to speed up mypy | ||
uses: actions/cache@v4 | ||
env: | ||
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "2" | ||
with: | ||
path: | | ||
${{ env.WORKDIR }}/.mypy_cache_test | ||
key: mypy-test-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }} | ||
- name: Clean up temporary files | ||
run: | | ||
rm -rf ${{ env.WORKDIR }}/.mypy_cache | ||
rm -rf ${{ env.WORKDIR }}/.mypy_cache_test | ||
rm -rf ${{ env.WORKDIR }}/.ruff_cache | ||
poetry cache clear pypi --all | ||
- name: Analysing the code with our lint | ||
working-directory: ${{ inputs.working-directory }} | ||
run: | | ||
make lint_tests |