mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-02-12 14:32:45 +00:00
62 lines
1.7 KiB
YAML
62 lines
1.7 KiB
YAML
name: Invariant gateway testing CI
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
name: Build & Test
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set Up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.11"
|
|
|
|
- name: Install Dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install pytest
|
|
|
|
- name: Run unit tests
|
|
id: unit-tests
|
|
run: |
|
|
pip install -r tests/unit_tests/requirements.txt
|
|
./run.sh unit-tests -s -vv
|
|
continue-on-error: true
|
|
|
|
- name: Run integration tests
|
|
id: integration-tests
|
|
env:
|
|
OPENAI_API_KEY: ${{ secrets.INVARIANT_TESTING_OPENAI_KEY }}
|
|
ANTHROPIC_API_KEY: ${{ secrets.INVARIANT_TESTING_ANTHROPIC_KEY }}
|
|
GEMINI_API_KEY: ${{ secrets.INVARIANT_TESTING_GEMINI_KEY }}
|
|
INVARIANT_API_KEY: ${{ secrets.INVARIANT_TESTING_GUARDRAILS_KEY }}
|
|
run: ./run.sh integration-tests -s -vv
|
|
continue-on-error: true
|
|
|
|
- name: Check test results
|
|
run: |
|
|
echo "Unit tests outcome: ${{ steps.unit-tests.outcome }}"
|
|
echo "Integration tests outcome: ${{ steps.integration-tests.outcome }}"
|
|
|
|
if [[ "${{ steps.unit-tests.outcome }}" != "success" ]]; then
|
|
echo "Unit tests failed"
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "${{ steps.integration-tests.outcome }}" != "success" ]]; then
|
|
echo "Integration tests failed"
|
|
exit 1
|
|
fi
|