ci-app.yml 6.3 KB

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