validate-test-suites.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. name: Validate Test Suites
  2. on:
  3. push:
  4. paths:
  5. - 'evals/agents/*/config/**/*.json'
  6. - 'evals/agents/*/tests/**/*.yaml'
  7. - 'scripts/validation/validate-test-suites.sh'
  8. - '.github/workflows/validate-test-suites.yml'
  9. pull_request:
  10. paths:
  11. - 'evals/agents/*/config/**/*.json'
  12. - 'evals/agents/*/tests/**/*.yaml'
  13. - 'scripts/validation/validate-test-suites.sh'
  14. - '.github/workflows/validate-test-suites.yml'
  15. workflow_dispatch:
  16. permissions:
  17. contents: read
  18. jobs:
  19. validate:
  20. name: Validate Test Suite Definitions
  21. runs-on: ubuntu-latest
  22. steps:
  23. - name: Checkout code
  24. uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
  25. - name: Setup Node.js
  26. uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
  27. with:
  28. node-version: '20'
  29. cache: 'npm'
  30. cache-dependency-path: 'package-lock.json'
  31. - name: Install dependencies
  32. run: |
  33. npm ci
  34. - name: Validate all test suites
  35. run: |
  36. cd evals/framework
  37. npm run validate:suites:all
  38. - name: Comment on PR (if validation failed)
  39. if: failure() && github.event_name == 'pull_request'
  40. uses: actions/github-script@f28e40c7f34bde8b3046d885e986cb6290c5673b # v7
  41. with:
  42. script: |
  43. github.rest.issues.createComment({
  44. issue_number: context.issue.number,
  45. owner: context.repo.owner,
  46. repo: context.repo.repo,
  47. body: '❌ **Test Suite Validation Failed**\n\nPlease check the test suite JSON files for errors. Run `npm run validate:suites` locally to see details.'
  48. })
  49. - name: Upload validation report
  50. if: always()
  51. uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
  52. with:
  53. name: suite-validation-report
  54. path: |
  55. evals/agents/*/config/**/*.json
  56. scripts/validation/validate-test-suites.sh
  57. retention-days: 7