ci-app.yml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. name: Node CI for app development
  2. on:
  3. push:
  4. branches-ignore:
  5. - release/**
  6. - rc/**
  7. - changeset-release/**
  8. paths:
  9. - .github/mergify.yml
  10. - .github/workflows/ci-app.yml
  11. - .eslint*
  12. - tsconfig.base.json
  13. - turbo.json
  14. - yarn.lock
  15. - package.json
  16. - apps/app/**
  17. - '!apps/app/docker/**'
  18. - packages/**
  19. concurrency:
  20. group: ${{ github.workflow }}-${{ github.ref }}
  21. cancel-in-progress: true
  22. jobs:
  23. ci-app-lint:
  24. runs-on: ubuntu-latest
  25. strategy:
  26. matrix:
  27. node-version: [20.x]
  28. steps:
  29. - uses: actions/checkout@v4
  30. - uses: actions/setup-node@v4
  31. with:
  32. node-version: ${{ matrix.node-version }}
  33. cache: 'yarn'
  34. cache-dependency-path: '**/yarn.lock'
  35. - name: Cache/Restore node_modules
  36. uses: actions/cache@v4
  37. with:
  38. path: |
  39. **/node_modules
  40. !**/node_modules/.cache/turbo
  41. key: node_modules-app-devdependencies-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
  42. restore-keys: |
  43. node_modules-app-devdependencies-${{ runner.OS }}-node${{ matrix.node-version }}-
  44. - name: Cache/Restore dist
  45. uses: actions/cache@v4
  46. with:
  47. path: |
  48. **/.turbo
  49. **/dist
  50. **/node_modules/.cache/turbo
  51. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  52. restore-keys: |
  53. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  54. - name: Install dependencies
  55. run: |
  56. yarn global add turbo
  57. yarn global add node-gyp
  58. yarn --frozen-lockfile
  59. - name: Lint
  60. run: |
  61. turbo run lint --filter=!@growi/slackbot-proxy
  62. - name: Slack Notification
  63. uses: weseek/ghaction-slack-notification@master
  64. if: failure()
  65. with:
  66. type: ${{ job.status }}
  67. job_name: '*Node CI for growi - lint (${{ matrix.node-version }})*'
  68. channel: '#ci'
  69. isCompactMode: true
  70. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  71. ci-app-test:
  72. runs-on: ubuntu-latest
  73. strategy:
  74. matrix:
  75. node-version: [20.x]
  76. services:
  77. mongodb:
  78. image: mongo:6.0
  79. ports:
  80. - 27017/tcp
  81. steps:
  82. - uses: actions/checkout@v4
  83. - uses: actions/setup-node@v4
  84. with:
  85. node-version: ${{ matrix.node-version }}
  86. cache: 'yarn'
  87. cache-dependency-path: '**/yarn.lock'
  88. - name: Cache/Restore node_modules
  89. uses: actions/cache@v4
  90. with:
  91. path: |
  92. **/node_modules
  93. !**/node_modules/.cache/turbo
  94. key: node_modules-app-devdependencies-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
  95. restore-keys: |
  96. node_modules-app-devdependencies-${{ runner.OS }}-node${{ matrix.node-version }}-
  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. yarn global add turbo
  110. yarn global add node-gyp
  111. yarn --frozen-lockfile
  112. - name: Test
  113. run: |
  114. turbo run test --filter=!@growi/slackbot-proxy --env-mode=loose
  115. env:
  116. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
  117. - name: Upload coverage report as artifact
  118. uses: actions/upload-artifact@v4
  119. with:
  120. name: Coverage Report
  121. path: |
  122. apps/app/coverage
  123. packages/remark-growi-directive/coverage
  124. - name: Slack Notification
  125. uses: weseek/ghaction-slack-notification@master
  126. if: failure()
  127. with:
  128. type: ${{ job.status }}
  129. job_name: '*Node CI for growi - test (${{ matrix.node-version }})*'
  130. channel: '#ci'
  131. isCompactMode: true
  132. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  133. ci-app-launch-dev:
  134. runs-on: ubuntu-latest
  135. strategy:
  136. matrix:
  137. node-version: [20.x]
  138. services:
  139. mongodb:
  140. image: mongo:6.0
  141. ports:
  142. - 27017/tcp
  143. steps:
  144. - uses: actions/checkout@v4
  145. - uses: actions/setup-node@v4
  146. with:
  147. node-version: ${{ matrix.node-version }}
  148. cache: 'yarn'
  149. cache-dependency-path: '**/yarn.lock'
  150. - name: Cache/Restore node_modules
  151. uses: actions/cache@v4
  152. with:
  153. path: |
  154. **/node_modules
  155. !**/node_modules/.cache/turbo
  156. key: node_modules-app-devdependencies-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
  157. restore-keys: |
  158. node_modules-app-devdependencies-${{ runner.OS }}-node${{ matrix.node-version }}-
  159. node_modules-app-devdependencies-${{ runner.OS }}-node${{ matrix.node-version }}-
  160. - name: Cache/Restore dist
  161. uses: actions/cache@v4
  162. with:
  163. path: |
  164. **/.turbo
  165. **/dist
  166. **/node_modules/.cache/turbo
  167. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  168. restore-keys: |
  169. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  170. - name: Install dependencies
  171. run: |
  172. yarn global add turbo
  173. yarn global add node-gyp
  174. yarn --frozen-lockfile
  175. - name: turbo run dev:ci
  176. working-directory: ./apps/app
  177. run: |
  178. cp config/ci/.env.local.for-ci .env.development.local
  179. turbo run dev:ci --env-mode=loose
  180. env:
  181. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_dev
  182. - name: Slack Notification
  183. uses: weseek/ghaction-slack-notification@master
  184. if: failure()
  185. with:
  186. type: ${{ job.status }}
  187. job_name: '*Node CI for growi - launch-dev (${{ matrix.node-version }})*'
  188. channel: '#ci'
  189. isCompactMode: true
  190. url: ${{ secrets.SLACK_WEBHOOK_URL }}