ci-app.yml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. name: Node CI for app development
  2. on:
  3. push:
  4. branches-ignore:
  5. - release/**
  6. - rc/**
  7. - changeset-release/**
  8. - mergify/merge-queue/**
  9. - tmp-mergify/merge-queue/**
  10. paths:
  11. - .github/mergify.yml
  12. - .github/workflows/ci-app.yml
  13. - biome.json
  14. - tsconfig.base.json
  15. - turbo.json
  16. - pnpm-lock.yaml
  17. - package.json
  18. - apps/app/**
  19. - '!apps/app/docker/**'
  20. - packages/**
  21. pull_request:
  22. types: [opened, reopened, synchronize]
  23. paths:
  24. - .github/mergify.yml
  25. - .github/workflows/ci-app.yml
  26. - biome.json
  27. - tsconfig.base.json
  28. - turbo.json
  29. - pnpm-lock.yaml
  30. - package.json
  31. - apps/app/**
  32. - '!apps/app/docker/**'
  33. - packages/**
  34. concurrency:
  35. group: ${{ github.workflow }}-${{ github.ref }}
  36. cancel-in-progress: true
  37. jobs:
  38. ci-app-lint:
  39. runs-on: ubuntu-latest
  40. strategy:
  41. matrix:
  42. node-version: [24.x]
  43. steps:
  44. - uses: actions/checkout@v6
  45. - uses: pnpm/action-setup@v6
  46. - uses: actions/setup-node@v6
  47. with:
  48. node-version: ${{ matrix.node-version }}
  49. cache: 'pnpm'
  50. - name: Cache/Restore dist
  51. uses: actions/cache@v4
  52. with:
  53. path: |
  54. **/.turbo
  55. **/dist
  56. **/node_modules/.cache/turbo
  57. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  58. restore-keys: |
  59. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  60. - name: Install dependencies
  61. run: |
  62. pnpm add turbo --global
  63. pnpm install --frozen-lockfile
  64. - name: Lint
  65. run: |
  66. turbo run lint --filter=@growi/app --filter=./packages/*
  67. - name: Slack Notification
  68. uses: weseek/ghaction-slack-notification@master
  69. if: failure()
  70. with:
  71. type: ${{ job.status }}
  72. job_name: '*Node CI for growi - lint (${{ matrix.node-version }})*'
  73. channel: '#ci'
  74. isCompactMode: true
  75. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  76. ci-app-test:
  77. runs-on: ubuntu-latest
  78. strategy:
  79. matrix:
  80. node-version: [24.x]
  81. mongodb-version: ['6.0', '8.0']
  82. services:
  83. mongodb:
  84. image: mongo:${{ matrix.mongodb-version }}
  85. ports:
  86. - 27017/tcp
  87. steps:
  88. - uses: actions/checkout@v6
  89. - uses: pnpm/action-setup@v6
  90. - &setup-node-step
  91. uses: actions/setup-node@v6
  92. with:
  93. node-version: ${{ matrix.node-version }}
  94. cache: 'pnpm'
  95. - &cache-restore-dist-step
  96. name: Cache/Restore dist
  97. uses: actions/cache@v4
  98. with:
  99. path: |
  100. **/.turbo
  101. **/dist
  102. **/node_modules/.cache/turbo
  103. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  104. restore-keys: |
  105. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  106. - &install-dependencies-step
  107. name: Install dependencies
  108. run: |
  109. pnpm add turbo --global
  110. pnpm install --frozen-lockfile
  111. - name: Test (app - unit & component)
  112. run: |
  113. turbo run test:unit test:components --filter=@growi/app --env-mode=loose
  114. env:
  115. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
  116. - name: Test (packages)
  117. run: |
  118. turbo run test --filter=./packages/* --env-mode=loose
  119. - name: Slack Notification
  120. uses: weseek/ghaction-slack-notification@master
  121. if: failure()
  122. with:
  123. type: ${{ job.status }}
  124. job_name: '*Node CI for growi - test (${{ matrix.node-version }})*'
  125. channel: '#ci'
  126. isCompactMode: true
  127. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  128. ci-app-test-integration:
  129. runs-on: ubuntu-latest
  130. strategy:
  131. matrix:
  132. node-version: [24.x]
  133. mongodb-version: ['8.0']
  134. elasticsearch-version:
  135. - env: 8
  136. stack-version: '8.19.16'
  137. - env: 9
  138. stack-version: '9.3.3'
  139. # [MEMO] Elasticsearch is started in a step to install plugins before starting it.
  140. services:
  141. mongodb:
  142. image: mongo:${{ matrix.mongodb-version }}
  143. ports:
  144. - 27017/tcp
  145. steps:
  146. - uses: actions/checkout@v6
  147. - uses: pnpm/action-setup@v6
  148. - *setup-node-step
  149. - *cache-restore-dist-step
  150. - *install-dependencies-step
  151. - name: Start Elasticsearch with plugins
  152. uses: elastic/elastic-github-actions/elasticsearch@master
  153. with:
  154. stack-version: ${{ matrix.elasticsearch-version.stack-version }}
  155. plugins: |
  156. analysis-kuromoji
  157. analysis-icu
  158. security-enabled: false
  159. - name: Wait for Elasticsearch to be ready
  160. run: |
  161. curl \
  162. --no-progress-meter \
  163. -X GET \
  164. --retry 60 \
  165. --retry-delay 1 \
  166. --retry-connrefused \
  167. http://localhost:9200/_cluster/health?wait_for_status=green
  168. - name: Test
  169. run: |
  170. turbo run test:integ --filter=@growi/app --env-mode=loose
  171. env:
  172. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
  173. VITE_ELASTICSEARCH_URI: http://localhost:9200/growi
  174. VITE_ELASTICSEARCH_VERSION: ${{ matrix.elasticsearch-version.env }}
  175. - name: Slack Notification
  176. uses: weseek/ghaction-slack-notification@master
  177. if: failure()
  178. with:
  179. type: ${{ job.status }}
  180. job_name: '*Node CI for growi - test-es (${{ matrix.node-version }})*'
  181. channel: '#ci'
  182. isCompactMode: true
  183. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  184. ci-app-launch-dev:
  185. runs-on: ubuntu-latest
  186. strategy:
  187. matrix:
  188. node-version: [24.x]
  189. mongodb-version: ['6.0', '8.0']
  190. services:
  191. mongodb:
  192. image: mongo:${{ matrix.mongodb-version }}
  193. ports:
  194. - 27017/tcp
  195. steps:
  196. - uses: actions/checkout@v6
  197. - uses: pnpm/action-setup@v6
  198. - uses: actions/setup-node@v6
  199. with:
  200. node-version: ${{ matrix.node-version }}
  201. cache: 'pnpm'
  202. - name: Cache/Restore dist
  203. uses: actions/cache@v4
  204. with:
  205. path: |
  206. **/.turbo
  207. **/dist
  208. **/node_modules/.cache/turbo
  209. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  210. restore-keys: |
  211. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  212. - name: Install dependencies
  213. run: |
  214. pnpm add turbo --global
  215. pnpm install --frozen-lockfile
  216. - name: turbo run launch-dev:ci
  217. working-directory: ./apps/app
  218. run: |
  219. cp config/ci/.env.local.for-ci .env.development.local
  220. turbo run launch-dev:ci --env-mode=loose
  221. env:
  222. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_dev
  223. - name: Slack Notification
  224. uses: weseek/ghaction-slack-notification@master
  225. if: failure()
  226. with:
  227. type: ${{ job.status }}
  228. job_name: '*Node CI for growi - launch-dev (${{ matrix.node-version }})*'
  229. channel: '#ci'
  230. isCompactMode: true
  231. url: ${{ secrets.SLACK_WEBHOOK_URL }}