Prerequisites
Before setting up CI/CD integration:- Trusys API Key โ Obtain your API key from the Trusys dashboard
- Application and Library โ Have your application and prompt library configured in Trusys
- CLI Commands โ Refer to the Using CLI documentation for detailed command reference
Basic GitHub Actions Integration
This example runs Trusys evaluations automatically when you push tags matching the patterntest-cli*.
Setup Steps
-
Add API Key to Secrets: Add a new secret named
TRUSYS_API_KEYwith your Trusys API key -
Configure Environment Variables:
- Update
TRUSYS_APPLICATIONwith your application name - Update
TRUSYS_LIBRARYwith your prompt library name
- Update
-
Trigger the Workflow: Push a tag matching the pattern:
git tag test-cli-v1 && git push origin test-cli-v1
Advanced Integration with Metric Validation
This example includes custom validation logic to check specific assertion types and fail the pipeline based on your criteria.- TRUSYS_RELEVANT_ASSERTION_TYPES โ Comma-separated list of assertion types to validate (e.g.,
icontains,llm-rubric,equals) - Customize the validation logic in the Node.js script to match your specific requirements
Key Features
- Output to File โ The
--output "results.json"flag saves evaluation results for custom validation - Continue on Error โ The
continue-on-error: trueensures results are captured even if some tests fail - Custom Validation โ The validation step filters and checks specific assertion types defined in
TRUSYS_RELEVANT_ASSERTION_TYPES - Detailed Failure Reporting โ Failed assertions are logged with prompts, assertion types, and failure reasons