Skip to content

Jw/tool bindings embeddings #51

Jw/tool bindings embeddings

Jw/tool bindings embeddings #51

Workflow file for this run

name: CI
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
jobs:
build-and-test:
runs-on: pub-hk-ubuntu-22.04-small
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure Poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache Poetry virtualenv
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-
- name: Install dependencies (including test, lint, typing, and test_integration)
run: poetry install --with test,lint,typing,test_integration
- name: Run linting checks
run: |
poetry run ruff check .
poetry run ruff format . --check
- name: Run type checking
run: poetry run mypy .
- name: Run tests
run: poetry run pytest --maxfail=1 --disable-warnings --tb=short --ignore=tests/integration_tests/
- name: Upload pytest results (optional)
if: always()
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: .pytest_cache
integration-tests:
runs-on: pub-hk-ubuntu-22.04-small
environment: INTEGRATION_TESTING
needs: build-and-test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure Poetry
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: Cache Poetry virtualenv
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-${{ runner.os }}-
- name: Install dependencies (including test, lint, typing, and test_integration)
run: poetry install --with test,lint,typing,test_integration
- name: Run integration tests
env:
INFERENCE_URL: ${{ vars.INFERENCE_URL }}
INFERENCE_MODEL_ID: ${{ vars.INFERENCE_MODEL_ID }}
INFERENCE_KEY: ${{ secrets.INFERENCE_KEY }}
INFERENCE_EMBEDDING_MODEL_ID: ${{ vars.INFERENCE_EMBEDDING_MODEL_ID }}
INFERENCE_EMBEDDING_KEY: ${{ secrets.INFERENCE_EMBEDDING_KEY }}
run: poetry run pytest tests/integration_tests/ --maxfail=1 --disable-warnings --tb=short