Skip to content

fix(deps): support gliner2 2.0 by declaring the deps it moved to an e… #130

fix(deps): support gliner2 2.0 by declaring the deps it moved to an e…

fix(deps): support gliner2 2.0 by declaring the deps it moved to an e… #130

name: Integration Tests
on:
push:
branches: [main]
paths:
- 'src/**'
- 'tests/**'
workflow_dispatch:
inputs:
include_heavy:
description: "Also run heavy e2e tests (ShieldGemma, Glider, Granite Guardian — need >5 GB RAM / a GPU)"
type: boolean
default: false
jobs:
run-integration-tests:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v7
with:
python-version: 3.13
activate-environment: true
- name: Install dependencies
run: |
uv sync --group tests --extra all
- name: Run Integration tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
CONTENT_SAFETY_KEY: ${{ secrets.CONTENT_SAFETY_KEY }}
CONTENT_SAFETY_ENDPOINT: ${{ secrets.CONTENT_SAFETY_ENDPOINT }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
ALINIA_ENDPOINT: ${{ secrets.ALINIA_ENDPOINT }}
ALINIA_API_KEY: ${{ secrets.ALINIA_API_KEY }}
LAKERA_API_KEY: ${{ secrets.LAKERA_API_KEY }}
PATRONUS_API_KEY: ${{ secrets.PATRONUS_API_KEY }}
# IBM watsonx Guardian (Granite Guardian): IAM API key + region URL + project.
# The test skips unless APIKEY, URL, and PROJECT_ID (or SPACE_ID) are all set.
WATSONX_APIKEY: ${{ secrets.WATSONX_APIKEY }}
WATSONX_URL: ${{ secrets.WATSONX_URL }}
WATSONX_PROJECT_ID: ${{ secrets.WATSONX_PROJECT_ID }}
# Bedrock API key (bearer token). boto3 >= 1.39 reads AWS_BEARER_TOKEN_BEDROCK
# natively for bedrock / bedrock-runtime calls; no SigV4 creds needed.
AWS_BEARER_TOKEN_BEDROCK: ${{ secrets.AWS_BEDROCK_API_KEY }}
# 0DIN Portal API key for SusFactor's hosted backend, exchanged for a
# short-lived JWT at request time. test_susfactor_api.py skips until it is
# set; test_susfactor.py (the gated local ONNX model) probes HF_TOKEN's
# access to 0dinai/susfactor-e5-large-onnx and skips if it lacks the gate.
ODIN_API_KEY: ${{ secrets.ODIN_API_KEY }}
AWS_DEFAULT_REGION: us-east-1
HF_HUB_DOWNLOAD_TIMEOUT: "300"
HF_HUB_ETAG_TIMEOUT: "30"
# `e2e` is auto-applied to every test under tests/integration/ by the
# directory conftest. `heavy` opt-in flips on the >5 GB models that
# don't fit on a vanilla GitHub runner.
run: |
if [ "${{ github.event.inputs.include_heavy }}" = "true" ]; then
pytest -v -m e2e tests/integration --reruns 3 --reruns-delay 10 --timeout 1800
else
pytest -v -m "e2e and not heavy" tests/integration --reruns 3 --reruns-delay 10 --timeout 600
fi