ci-app.yml 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  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@v4
  45. - uses: pnpm/action-setup@v4
  46. - uses: actions/setup-node@v4
  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. # disabled because it failed in CI
  65. # - name: Generate schema
  66. # run: |
  67. # pnpm run --filter @growi/app prisma:generate
  68. - name: Lint
  69. run: |
  70. turbo run lint --filter=@growi/app --filter=./packages/*
  71. - name: Slack Notification
  72. uses: weseek/ghaction-slack-notification@master
  73. if: failure()
  74. with:
  75. type: ${{ job.status }}
  76. job_name: '*Node CI for growi - lint (${{ matrix.node-version }})*'
  77. channel: '#ci'
  78. isCompactMode: true
  79. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  80. ci-app-test:
  81. runs-on: ubuntu-latest
  82. strategy:
  83. matrix:
  84. node-version: [24.x]
  85. mongodb-version: ['6.0', '8.0']
  86. services:
  87. mongodb:
  88. image: mongo:${{ matrix.mongodb-version }}
  89. ports:
  90. - 27017/tcp
  91. steps:
  92. - uses: actions/checkout@v4
  93. - uses: pnpm/action-setup@v4
  94. - uses: actions/setup-node@v4
  95. with:
  96. node-version: ${{ matrix.node-version }}
  97. cache: 'pnpm'
  98. - name: Cache/Restore dist
  99. uses: actions/cache@v4
  100. with:
  101. path: |
  102. **/.turbo
  103. **/dist
  104. **/node_modules/.cache/turbo
  105. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  106. restore-keys: |
  107. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  108. - name: Install dependencies
  109. run: |
  110. pnpm add turbo --global
  111. pnpm install --frozen-lockfile
  112. # disabled because it failed in CI
  113. # - name: Generate schema
  114. # run: |
  115. # pnpm run --filter @growi/app prisma:generate
  116. - name: Test
  117. run: |
  118. turbo run test --filter=@growi/app --filter=./packages/* --env-mode=loose
  119. env:
  120. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
  121. - name: Upload coverage report as artifact
  122. uses: actions/upload-artifact@v4
  123. with:
  124. name: coverage-mongo${{ matrix.mongodb-version }}
  125. path: |
  126. apps/app/coverage
  127. packages/remark-growi-directive/coverage
  128. - name: Slack Notification
  129. uses: weseek/ghaction-slack-notification@master
  130. if: failure()
  131. with:
  132. type: ${{ job.status }}
  133. job_name: '*Node CI for growi - test (${{ matrix.node-version }})*'
  134. channel: '#ci'
  135. isCompactMode: true
  136. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  137. ci-app-launch-dev:
  138. runs-on: ubuntu-latest
  139. strategy:
  140. matrix:
  141. node-version: [24.x]
  142. mongodb-version: ['6.0', '8.0']
  143. services:
  144. mongodb:
  145. image: mongo:${{ matrix.mongodb-version }}
  146. ports:
  147. - 27017/tcp
  148. steps:
  149. - uses: actions/checkout@v4
  150. - uses: pnpm/action-setup@v4
  151. - uses: actions/setup-node@v4
  152. with:
  153. node-version: ${{ matrix.node-version }}
  154. cache: 'pnpm'
  155. - name: Cache/Restore dist
  156. uses: actions/cache@v4
  157. with:
  158. path: |
  159. **/.turbo
  160. **/dist
  161. **/node_modules/.cache/turbo
  162. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  163. restore-keys: |
  164. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  165. - name: Install dependencies
  166. run: |
  167. pnpm add turbo --global
  168. pnpm install --frozen-lockfile
  169. # disabled because it failed in CI
  170. # - name: Generate schema
  171. # run: |
  172. # pnpm run --filter @growi/app prisma:generate
  173. - name: turbo run launch-dev:ci
  174. working-directory: ./apps/app
  175. run: |
  176. cp config/ci/.env.local.for-ci .env.development.local
  177. turbo run launch-dev:ci --env-mode=loose
  178. env:
  179. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_dev
  180. - name: Slack Notification
  181. uses: weseek/ghaction-slack-notification@master
  182. if: failure()
  183. with:
  184. type: ${{ job.status }}
  185. job_name: '*Node CI for growi - launch-dev (${{ matrix.node-version }})*'
  186. channel: '#ci'
  187. isCompactMode: true
  188. url: ${{ secrets.SLACK_WEBHOOK_URL }}