ci-app.yml 5.7 KB

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