code-qa.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. name: Code QA Roo Code
  2. on:
  3. workflow_dispatch:
  4. push:
  5. branches: [main]
  6. pull_request:
  7. types: [opened, reopened, ready_for_review, synchronize]
  8. branches: [main]
  9. jobs:
  10. compile:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Checkout code
  14. uses: actions/checkout@v4
  15. - name: Setup Node.js
  16. uses: actions/setup-node@v4
  17. with:
  18. node-version: '18'
  19. cache: 'npm'
  20. - name: Install dependencies
  21. run: npm run install:all
  22. - name: Compile
  23. run: npm run compile
  24. - name: Check types
  25. run: npm run check-types
  26. - name: Lint
  27. run: npm run lint
  28. unit-test:
  29. runs-on: ubuntu-latest
  30. steps:
  31. - name: Checkout code
  32. uses: actions/checkout@v4
  33. - name: Setup Node.js
  34. uses: actions/setup-node@v4
  35. with:
  36. node-version: '18'
  37. cache: 'npm'
  38. - name: Install dependencies
  39. run: npm run install:all
  40. - name: Run unit tests
  41. run: npm test
  42. integration-test:
  43. if: "${{ secrets.OPENROUTER_API_KEY != '' }}"
  44. strategy:
  45. matrix:
  46. os: [ubuntu-latest] # macos-latest, windows-latest
  47. runs-on: ${{ matrix.os }}
  48. steps:
  49. - name: Checkout code
  50. uses: actions/checkout@v4
  51. - name: Setup Node.js
  52. uses: actions/setup-node@v4
  53. with:
  54. node-version: '18'
  55. cache: 'npm'
  56. - name: Create env.integration file
  57. run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.integration
  58. - name: Check env.integration file
  59. run: cat .env.integration
  60. - name: Install dependencies
  61. run: npm run install:all
  62. - run: xvfb-run -a npm run test:integration
  63. if: runner.os == 'Linux'
  64. - run: npm run test:integration
  65. if: runner.os != 'Linux'