test-agents.yml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. name: Test Agents
  2. on:
  3. pull_request:
  4. branches: [ main, dev ]
  5. paths:
  6. - '.opencode/agent/**'
  7. - 'evals/**'
  8. - '.github/workflows/test-agents.yml'
  9. push:
  10. branches: [ main ]
  11. workflow_dispatch:
  12. jobs:
  13. test-openagent:
  14. name: Test OpenAgent
  15. runs-on: ubuntu-latest
  16. timeout-minutes: 10
  17. steps:
  18. - name: Checkout code
  19. uses: actions/checkout@v4
  20. - name: Setup Node.js
  21. uses: actions/setup-node@v4
  22. with:
  23. node-version: '20'
  24. cache: 'npm'
  25. cache-dependency-path: 'evals/framework/package-lock.json'
  26. - name: Install dependencies
  27. run: |
  28. cd evals/framework
  29. npm ci
  30. - name: Build framework
  31. run: |
  32. cd evals/framework
  33. npm run build
  34. - name: Run OpenAgent smoke test
  35. run: npm run test:ci:openagent
  36. env:
  37. CI: true
  38. - name: Upload test results
  39. if: always()
  40. uses: actions/upload-artifact@v4
  41. with:
  42. name: openagent-results
  43. path: evals/results/
  44. retention-days: 30
  45. test-opencoder:
  46. name: Test OpenCoder
  47. runs-on: ubuntu-latest
  48. timeout-minutes: 10
  49. steps:
  50. - name: Checkout code
  51. uses: actions/checkout@v4
  52. - name: Setup Node.js
  53. uses: actions/setup-node@v4
  54. with:
  55. node-version: '20'
  56. cache: 'npm'
  57. cache-dependency-path: 'evals/framework/package-lock.json'
  58. - name: Install dependencies
  59. run: |
  60. cd evals/framework
  61. npm ci
  62. - name: Build framework
  63. run: |
  64. cd evals/framework
  65. npm run build
  66. - name: Run OpenCoder smoke test
  67. run: npm run test:ci:opencoder
  68. env:
  69. CI: true
  70. - name: Upload test results
  71. if: always()
  72. uses: actions/upload-artifact@v4
  73. with:
  74. name: opencoder-results
  75. path: evals/results/
  76. retention-days: 30
  77. report-results:
  78. name: Report Test Results
  79. runs-on: ubuntu-latest
  80. needs: [test-openagent, test-opencoder]
  81. if: always()
  82. steps:
  83. - name: Download OpenAgent results
  84. uses: actions/download-artifact@v4
  85. with:
  86. name: openagent-results
  87. path: results/openagent
  88. continue-on-error: true
  89. - name: Download OpenCoder results
  90. uses: actions/download-artifact@v4
  91. with:
  92. name: opencoder-results
  93. path: results/opencoder
  94. continue-on-error: true
  95. - name: Display results summary
  96. run: |
  97. echo "## Test Results Summary" >> $GITHUB_STEP_SUMMARY
  98. echo "" >> $GITHUB_STEP_SUMMARY
  99. if [ -f results/openagent/latest.json ]; then
  100. echo "### OpenAgent" >> $GITHUB_STEP_SUMMARY
  101. cat results/openagent/latest.json | jq -r '"- Passed: \(.passed)\n- Failed: \(.failed)\n- Total: \(.total)"' >> $GITHUB_STEP_SUMMARY
  102. fi
  103. if [ -f results/opencoder/latest.json ]; then
  104. echo "" >> $GITHUB_STEP_SUMMARY
  105. echo "### OpenCoder" >> $GITHUB_STEP_SUMMARY
  106. cat results/opencoder/latest.json | jq -r '"- Passed: \(.passed)\n- Failed: \(.failed)\n- Total: \(.total)"' >> $GITHUB_STEP_SUMMARY
  107. fi