156 lines
4.0 KiB
YAML
156 lines
4.0 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- dev
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
- dev
|
|
- feat/*
|
|
- 0.*.*
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
LicenseChecks:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
|
|
- name: Install Dependencies
|
|
# TODO: fix errors so that we can run `make dev` instead
|
|
run: |
|
|
# Setup Virtual Environment
|
|
python3 -m venv ./.venv
|
|
source .venv/bin/activate
|
|
make dev
|
|
|
|
- name: Check license
|
|
run: |
|
|
source .venv/bin/activate
|
|
.venv/bin/pip install greenlet "setuptools<81"
|
|
.venv/bin/liccheck
|
|
Linting:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
# Setup Virtual Environment
|
|
python3 -m venv ./.venv
|
|
source .venv/bin/activate
|
|
make dev
|
|
|
|
- name: Lint with ruff
|
|
run: |
|
|
source .venv/bin/activate
|
|
make lint
|
|
|
|
Typing:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
# Setup Virtual Environment
|
|
python3 -m venv ./.venv
|
|
source .venv/bin/activate
|
|
make full
|
|
|
|
- name: Static analysis with pyright
|
|
run: |
|
|
source .venv/bin/activate
|
|
make type
|
|
|
|
Pytests:
|
|
runs-on: LargeBois
|
|
strategy:
|
|
matrix:
|
|
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
# TODO: fix errors so that we can run both `make dev` and `make full`
|
|
# dependencies: ['dev', 'full']
|
|
# dependencies: ["full"]
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Create .guardrailsrc
|
|
run: |
|
|
echo 'id="SYSTEM TESTING"' > ~/.guardrailsrc
|
|
echo 'enable_metrics=false' >> ~/.guardrailsrc
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
- name: Install Poetry
|
|
uses: snok/install-poetry@v1
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
# Setup Virtual Environment
|
|
python3 -m venv ./.venv
|
|
source .venv/bin/activate
|
|
|
|
make full
|
|
|
|
if [ "${{ matrix.python-version }}" == "3.12" ]; then
|
|
echo "Installing latest langchain-core and langsmith from PyPI"
|
|
pip install "langchain-core>=0.2" "langsmith<0.2.0,>=0.1.75"
|
|
fi
|
|
|
|
- name: Run Pytests
|
|
run: |
|
|
source .venv/bin/activate
|
|
|
|
echo "langchain-core version:"
|
|
pip show langchain-core
|
|
echo "langsmith version:"
|
|
pip show langsmith
|
|
|
|
make test-cov
|
|
|
|
- name: Upload to codecov.io
|
|
uses: codecov/codecov-action@v3
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
file: ./coverage.xml
|
|
flags: unittests
|
|
name: codecov-umbrella
|
|
fail_ci_if_error: true |