ci-app.yml 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  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. - uses: actions/setup-node@v6
  91. with:
  92. node-version: ${{ matrix.node-version }}
  93. cache: 'pnpm'
  94. - &cache-restore-dist-step
  95. name: Cache/Restore dist
  96. uses: actions/cache@v4
  97. with:
  98. path: |
  99. **/.turbo
  100. **/dist
  101. **/node_modules/.cache/turbo
  102. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  103. restore-keys: |
  104. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  105. - name: Install dependencies
  106. run: |
  107. pnpm add turbo --global
  108. pnpm install --frozen-lockfile
  109. - name: Test
  110. run: |
  111. turbo run test --filter=@growi/app --filter=./packages/* --env-mode=loose
  112. env:
  113. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
  114. - name: Upload coverage report as artifact
  115. uses: actions/upload-artifact@v7
  116. with:
  117. name: coverage-mongo${{ matrix.mongodb-version }}
  118. path: |
  119. apps/app/coverage
  120. packages/remark-growi-directive/coverage
  121. - name: Slack Notification
  122. uses: weseek/ghaction-slack-notification@master
  123. if: failure()
  124. with:
  125. type: ${{ job.status }}
  126. job_name: '*Node CI for growi - test (${{ matrix.node-version }})*'
  127. channel: '#ci'
  128. isCompactMode: true
  129. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  130. ci-app-test-integration:
  131. runs-on: ubuntu-latest
  132. strategy:
  133. matrix:
  134. node-version: [24.x]
  135. mongodb-version: ['8.0']
  136. elasticsearch-version: ['9.3.3']
  137. services:
  138. mongodb:
  139. image: mongo:${{ matrix.mongodb-version }}
  140. ports:
  141. - 27017/tcp
  142. elasticsearch:
  143. image: docker.elastic.co/elasticsearch/elasticsearch:${{ matrix.elasticsearch-version }}
  144. ports:
  145. - 9200/tcp
  146. env:
  147. discovery.type: single-node
  148. ES_JAVA_OPTS: -Xms256m -Xmx256m
  149. xpack.security.enabled: "false"
  150. options: >-
  151. --health-cmd="curl -sf http://localhost:9200/_cluster/health?wait_for_status=yellow&timeout=30s || exit 1"
  152. --health-interval=15s
  153. --health-timeout=40s
  154. --health-retries=5
  155. steps:
  156. - uses: actions/checkout@v6
  157. - uses: pnpm/action-setup@v6
  158. - uses: actions/setup-node@v6
  159. with:
  160. node-version: ${{ matrix.node-version }}
  161. cache: 'pnpm'
  162. - *cache-restore-dist-step
  163. - name: Install dependencies
  164. run: |
  165. pnpm add turbo --global
  166. pnpm install --frozen-lockfile
  167. - name: Test
  168. run: |
  169. turbo run test:integ --filter=@growi/app --env-mode=loose
  170. env:
  171. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
  172. VITE_ELASTICSEARCH_URI: http://localhost:${{ job.services.elasticsearch.ports['9200'] }}/growi
  173. - name: Upload coverage report as artifact
  174. uses: actions/upload-artifact@v7
  175. with:
  176. name: coverage-es9-mongo8.0
  177. path: |
  178. apps/app/coverage
  179. - name: Slack Notification
  180. uses: weseek/ghaction-slack-notification@master
  181. if: failure()
  182. with:
  183. type: ${{ job.status }}
  184. job_name: '*Node CI for growi - test-es (${{ matrix.node-version }})*'
  185. channel: '#ci'
  186. isCompactMode: true
  187. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  188. ci-app-launch-dev:
  189. runs-on: ubuntu-latest
  190. strategy:
  191. matrix:
  192. node-version: [24.x]
  193. mongodb-version: ['6.0', '8.0']
  194. services:
  195. mongodb:
  196. image: mongo:${{ matrix.mongodb-version }}
  197. ports:
  198. - 27017/tcp
  199. steps:
  200. - uses: actions/checkout@v6
  201. - uses: pnpm/action-setup@v6
  202. - uses: actions/setup-node@v6
  203. with:
  204. node-version: ${{ matrix.node-version }}
  205. cache: 'pnpm'
  206. - name: Cache/Restore dist
  207. uses: actions/cache@v4
  208. with:
  209. path: |
  210. **/.turbo
  211. **/dist
  212. **/node_modules/.cache/turbo
  213. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  214. restore-keys: |
  215. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  216. - name: Install dependencies
  217. run: |
  218. pnpm add turbo --global
  219. pnpm install --frozen-lockfile
  220. - name: turbo run launch-dev:ci
  221. working-directory: ./apps/app
  222. run: |
  223. cp config/ci/.env.local.for-ci .env.development.local
  224. turbo run launch-dev:ci --env-mode=loose
  225. env:
  226. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_dev
  227. - name: Slack Notification
  228. uses: weseek/ghaction-slack-notification@master
  229. if: failure()
  230. with:
  231. type: ${{ job.status }}
  232. job_name: '*Node CI for growi - launch-dev (${{ matrix.node-version }})*'
  233. channel: '#ci'
  234. isCompactMode: true
  235. url: ${{ secrets.SLACK_WEBHOOK_URL }}