ci-app.yml 6.2 KB

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