code-qa.yml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. check-translations:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - name: Checkout code
  14. uses: actions/checkout@v4
  15. - name: Setup Node.js and pnpm
  16. uses: ./.github/actions/setup-node-pnpm
  17. - name: Verify all translations are complete
  18. run: node scripts/find-missing-translations.js
  19. knip:
  20. runs-on: ubuntu-latest
  21. steps:
  22. - name: Checkout code
  23. uses: actions/checkout@v4
  24. - name: Setup Node.js and pnpm
  25. uses: ./.github/actions/setup-node-pnpm
  26. - name: Run knip checks
  27. run: pnpm knip
  28. compile:
  29. runs-on: ubuntu-latest
  30. steps:
  31. - name: Checkout code
  32. uses: actions/checkout@v4
  33. - name: Setup Node.js and pnpm
  34. uses: ./.github/actions/setup-node-pnpm
  35. - name: Lint
  36. run: pnpm lint
  37. - name: Check types
  38. run: pnpm check-types
  39. platform-unit-test:
  40. runs-on: ${{ matrix.os }}
  41. strategy:
  42. matrix:
  43. os: [ubuntu-latest, windows-latest]
  44. steps:
  45. - name: Checkout code
  46. uses: actions/checkout@v4
  47. - name: Setup Node.js and pnpm
  48. uses: ./.github/actions/setup-node-pnpm
  49. - name: Run unit tests
  50. run: pnpm test
  51. check-openrouter-api-key:
  52. runs-on: ubuntu-latest
  53. outputs:
  54. exists: ${{ steps.openrouter-api-key-check.outputs.defined }}
  55. steps:
  56. - name: Check if OpenRouter API key exists
  57. id: openrouter-api-key-check
  58. shell: bash
  59. run: |
  60. if [ "${{ secrets.OPENROUTER_API_KEY }}" != '' ]; then
  61. echo "defined=true" >> $GITHUB_OUTPUT;
  62. else
  63. echo "defined=false" >> $GITHUB_OUTPUT;
  64. fi
  65. integration-test:
  66. runs-on: ubuntu-latest
  67. needs: [check-openrouter-api-key]
  68. if: needs.check-openrouter-api-key.outputs.exists == 'true'
  69. steps:
  70. - name: Checkout code
  71. uses: actions/checkout@v4
  72. - name: Setup Node.js and pnpm
  73. uses: ./.github/actions/setup-node-pnpm
  74. - name: Create .env.local file
  75. working-directory: apps/vscode-e2e
  76. run: echo "OPENROUTER_API_KEY=${{ secrets.OPENROUTER_API_KEY }}" > .env.local
  77. - name: Run integration tests
  78. working-directory: apps/vscode-e2e
  79. run: xvfb-run -a pnpm test:ci
  80. notify-slack-on-failure:
  81. runs-on: ubuntu-latest
  82. needs: [check-translations, knip, compile, platform-unit-test, integration-test]
  83. if: ${{ always() && github.event_name == 'push' && github.ref == 'refs/heads/main' && contains(needs.*.result, 'failure') }}
  84. steps:
  85. - name: Checkout code
  86. uses: actions/checkout@v4
  87. - name: Send Slack notification on failure
  88. uses: ./.github/actions/slack-notify
  89. with:
  90. webhook-url: ${{ secrets.SLACK_WEBHOOK_URL }}
  91. channel: "#ci"
  92. workflow-name: "Code QA"
  93. failed-jobs: ${{ toJSON(needs) }}