Skip to content

feat: improve content ai safety logging and responses #20

feat: improve content ai safety logging and responses

feat: improve content ai safety logging and responses #20

---
name: aep
on:
pull_request:
branches:
- 'main'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.12']
env:
AZURE_VAULT_ID: ${{ secrets.TEST_AZURE_VAULT_ID }}
AZURE_CLIENT_ID: ${{ secrets.TEST_AZURE_CLIENT_ID }}
AZURE_TENANT_ID: ${{ secrets.TEST_AZURE_TENANT_ID }}
AZURE_CLIENT_SECRET: ${{ secrets.TEST_AZURE_CLIENT_SECRET }}
AZURE_OPENAI_ENDPOINT: ${{ secrets.TEST_AZURE_OPENAI_ENDPOINT }}
AZURE_OPENAI_KEY: ${{ secrets.TEST_AZURE_OPENAI_KEY }}
OPENAI_API_KEY: ${{ secrets.TEST_AZURE_OPENAI_KEY }}
AZURE_CS_ENDPOINT: ${{ secrets.TEST_AZURE_CS_ENDPOINT }}
AZURE_CS_KEY: ${{ secrets.TEST_AZURE_CS_KEY }}
azure_openai_api_version: "2023-12-01-preview"
SYSTEM_API_KEY: "system"
OPENAI_API_TYPE: "azure"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f src/requirements.txt ]; then pip install -r src/requirements.txt; fi
- name: Run tests
working-directory: src/
run: |
pytest tests/ -vv -s --junit-xml=test-results.xml
- name: Surface failing tests
if: always()
uses: pmeier/pytest-results-action@main
with:
# A list of JUnit XML files, directories containing the former, and wildcard
# patterns to process.
# See @actions/glob for supported patterns.
path: src/test-results.xml
# (Optional) Add a summary of the results at the top of the report
summary: true
# (Optional) Select which results should be included in the report.
# Follows the same syntax as `pytest -r`
display-options: fEX
# (Optional) Fail the workflow if no JUnit XML was found.
fail-on-empty: true
# (Optional) Title of the test results section in the workflow summary
title: AEP Test Results
env:
CI: true