Skip to content

call_server_tests

call_server_tests #2

name: call_server_tests
on:
workflow_call:
inputs:
os:
required: false
type: string
default: ubuntu-latest
python-version:
required: true
type: string
workflow_dispatch:
inputs:
os:
required: false
type: string
default: ubuntu-latest
python-version:
required: false
type: string
default: "3.12"
commit_id:
description: 'Branch or Commit ID (optional)'
required: false
type: string
jobs:
server-tests:
runs-on: ${{ inputs.os }}
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.commit_id || github.sha }}
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -e .[all,test]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run server tests
shell: bash
run: |
pytest --cov=guidance --cov-report=xml --cov-report=term-missing \
./tests/server