SDK regeneration #877
This file contains hidden or 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: ci | |
| on: [push] | |
| jobs: | |
| compile: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Set up python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.9 | |
| - name: Bootstrap poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| version: 1.5.1 | |
| virtualenvs-in-project: false | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Compile | |
| run: poetry run mypy . | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Set up python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.9 | |
| - name: Bootstrap poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| version: 1.5.1 | |
| virtualenvs-in-project: false | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Install aws deps | |
| run: poetry run pip install boto3 sagemaker botocore | |
| - name: Test | |
| run: poetry run pytest . | |
| env: | |
| CO_API_KEY: ${{ secrets.COHERE_API_KEY }} | |
| test-langchain-cohere: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Set up python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.10.14 | |
| - name: Install and configure Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| version: 1.5.1 | |
| virtualenvs-in-project: false | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Test langchain-cohere | |
| run: | | |
| echo "Initial dir $(pwd)" | |
| cd .. | |
| echo "Cloning langchain-cohere..." | |
| git clone https://github.com/langchain-ai/langchain-cohere.git && cd langchain-cohere/libs/cohere | |
| echo "Cloned langchain-cohere, current dir $(pwd)" | |
| echo "poetry install --with test,test_integration" | |
| poetry install --with test,test_integration | |
| echo "Going to uninstall cohere package, and install the current version from the repo" | |
| poetry remove cohere | |
| poetry add ../../../cohere-python | |
| echo "Current cohere installation: $(poetry show cohere)" | |
| make test | |
| make integration_test | |
| echo "tests passed" | |
| # reset poetry changes | |
| git checkout -- poetry.lock pyproject.toml | |
| set -eu | |
| STATUS="$(git status)" | |
| echo "$STATUS" | |
| # grep will exit non-zero if the target message isn't found, | |
| # and `set -e` above will cause the step to fail. | |
| echo "$STATUS" | grep 'nothing to commit, working tree clean' | |
| env: | |
| COHERE_API_KEY: ${{ secrets.COHERE_API_KEY }} | |
| publish: | |
| needs: [compile, test] | |
| if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v3 | |
| - name: Set up python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.9 | |
| - name: Bootstrap poetry | |
| run: | | |
| curl -sSL https://install.python-poetry.org | python - -y --version 1.5.1 | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Publish to pypi | |
| run: | | |
| poetry config repositories.remote https://upload.pypi.org/legacy/ | |
| poetry --no-interaction -v publish --build --repository remote --username "$PYPI_USERNAME" --password "$PYPI_PASSWORD" | |
| env: | |
| PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
| PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} |