code-qa.yml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. name: Code QA Kilo 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. env:
  10. NODE_VERSION: 20.20.0
  11. PNPM_VERSION: 10.8.1
  12. TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
  13. TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
  14. jobs:
  15. compile:
  16. runs-on: ubuntu-latest
  17. steps:
  18. - name: Checkout code
  19. uses: actions/checkout@v6
  20. - name: Install pnpm
  21. uses: pnpm/action-setup@v4
  22. with:
  23. version: ${{ env.PNPM_VERSION }}
  24. - name: Setup Node.js
  25. uses: actions/setup-node@v6
  26. with:
  27. node-version: ${{ env.NODE_VERSION }}
  28. cache: "pnpm"
  29. - name: Turbo cache setup
  30. uses: actions/cache@v5
  31. with:
  32. path: .turbo
  33. key: ${{ runner.os }}-turbo-${{ github.sha }}
  34. restore-keys: |
  35. ${{ runner.os }}-turbo-
  36. - name: Install dependencies
  37. run: pnpm install
  38. - name: Build
  39. run: pnpm build
  40. - name: Check types
  41. run: pnpm check-types
  42. - name: Lint
  43. run: pnpm lint
  44. check-translations:
  45. runs-on: ubuntu-latest
  46. steps:
  47. - name: Checkout code
  48. uses: actions/checkout@v6
  49. - name: Install pnpm
  50. uses: pnpm/action-setup@v4
  51. with:
  52. version: ${{ env.PNPM_VERSION }}
  53. - name: Setup Node.js
  54. uses: actions/setup-node@v6
  55. with:
  56. node-version: "18"
  57. cache: "pnpm"
  58. - name: Turbo cache setup
  59. uses: actions/cache@v5
  60. with:
  61. path: .turbo
  62. key: ${{ runner.os }}-turbo-${{ github.sha }}
  63. restore-keys: |
  64. ${{ runner.os }}-turbo-
  65. - name: Install dependencies
  66. run: pnpm install
  67. - name: Verify all translations are complete
  68. run: node scripts/find-missing-translations.js
  69. test-extension:
  70. runs-on: ${{ matrix.os }}
  71. strategy:
  72. matrix:
  73. os: [ubuntu-latest, windows-latest]
  74. steps:
  75. - name: Checkout code
  76. uses: actions/checkout@v6
  77. - name: Install pnpm
  78. uses: pnpm/action-setup@v4
  79. with:
  80. version: ${{ env.PNPM_VERSION }}
  81. - name: Setup Node.js
  82. uses: actions/setup-node@v6
  83. with:
  84. node-version: ${{ env.NODE_VERSION }}
  85. cache: "pnpm"
  86. - name: Turbo cache setup
  87. uses: actions/cache@v5
  88. with:
  89. path: .turbo
  90. key: ${{ runner.os }}-turbo-${{ github.sha }}
  91. restore-keys: |
  92. ${{ runner.os }}-turbo-
  93. - name: Install dependencies
  94. run: pnpm install
  95. - name: Build (to build and copy WASM files)
  96. run: pnpm run vsix
  97. shell: bash
  98. - name: Run packages/types tests
  99. working-directory: packages/types
  100. run: pnpm test
  101. - name: Run packages/cloud tests
  102. working-directory: packages/cloud
  103. run: pnpm test
  104. - name: Run packages/telemetry tests
  105. working-directory: packages/telemetry
  106. run: pnpm test
  107. - name: Run extension unit tests
  108. working-directory: src
  109. run: pnpm test
  110. test-webview:
  111. runs-on: ${{ matrix.os }}
  112. strategy:
  113. matrix:
  114. os: [ubuntu-latest, windows-latest]
  115. steps:
  116. - name: Checkout code
  117. uses: actions/checkout@v6
  118. - name: Install pnpm
  119. uses: pnpm/action-setup@v4
  120. with:
  121. version: ${{ env.PNPM_VERSION }}
  122. - name: Setup Node.js
  123. uses: actions/setup-node@v6
  124. with:
  125. node-version: "18"
  126. cache: "pnpm"
  127. - name: Turbo cache setup
  128. uses: actions/cache@v5
  129. with:
  130. path: .turbo
  131. key: ${{ runner.os }}-turbo-${{ github.sha }}
  132. restore-keys: |
  133. ${{ runner.os }}-turbo-
  134. - name: Install dependencies
  135. run: pnpm install
  136. - name: Run unit tests
  137. working-directory: webview-ui
  138. run: pnpm test
  139. unit-test:
  140. needs: [test-extension, test-webview]
  141. runs-on: ubuntu-latest
  142. steps:
  143. - name: NO-OP
  144. run: echo "All unit tests passed."
  145. test-jetbrains:
  146. runs-on: ubuntu-latest
  147. steps:
  148. - name: Checkout code
  149. uses: actions/checkout@v6
  150. with:
  151. submodules: recursive
  152. lfs: true
  153. - name: Install pnpm
  154. uses: pnpm/action-setup@v4
  155. with:
  156. version: ${{ env.PNPM_VERSION }}
  157. - name: Setup Node.js
  158. uses: actions/setup-node@v6
  159. with:
  160. node-version: ${{ env.NODE_VERSION }}
  161. cache: "pnpm"
  162. - uses: actions/setup-java@v5
  163. with:
  164. distribution: "jetbrains"
  165. java-version: "21"
  166. check-latest: false
  167. env:
  168. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  169. - name: Setup Gradle
  170. uses: gradle/actions/setup-gradle@v5
  171. with:
  172. cache-read-only: ${{ github.ref != 'refs/heads/main' }}
  173. - name: Install system dependencies
  174. run: |
  175. sudo apt-get update
  176. sudo apt-get install -y \
  177. libx11-dev \
  178. libxkbfile-dev \
  179. pkg-config \
  180. build-essential \
  181. python3
  182. - name: Turbo cache setup
  183. uses: actions/cache@v5
  184. with:
  185. path: .turbo
  186. key: ${{ runner.os }}-turbo-${{ github.sha }}
  187. restore-keys: |
  188. ${{ runner.os }}-turbo-
  189. - name: Install dependencies
  190. run: pnpm install
  191. - name: Build
  192. run: pnpm run jetbrains:build
  193. shell: bash
  194. test-cli:
  195. runs-on: ubuntu-latest
  196. steps:
  197. - name: Checkout code
  198. uses: actions/checkout@v6
  199. - name: Install pnpm
  200. uses: pnpm/action-setup@v4
  201. with:
  202. version: ${{ env.PNPM_VERSION }}
  203. - name: Setup Node.js
  204. uses: actions/setup-node@v6
  205. with:
  206. node-version: ${{ env.NODE_VERSION }}
  207. cache: "pnpm"
  208. - name: Turbo cache setup
  209. uses: actions/cache@v5
  210. with:
  211. path: .turbo
  212. key: ${{ runner.os }}-turbo-${{ github.sha }}
  213. restore-keys: |
  214. ${{ runner.os }}-turbo-
  215. - name: Install dependencies
  216. run: pnpm install
  217. - name: Run unit tests
  218. working-directory: cli
  219. run: pnpm test