ci-app.yml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. name: Node CI for app development
  2. on:
  3. push:
  4. branches-ignore:
  5. - release/**
  6. - rc/**
  7. - chore/**
  8. - support/prepare-v**
  9. jobs:
  10. lint:
  11. runs-on: ubuntu-latest
  12. strategy:
  13. matrix:
  14. node-version: [16.x]
  15. steps:
  16. - uses: actions/checkout@v2
  17. - uses: actions/setup-node@v2
  18. with:
  19. node-version: ${{ matrix.node-version }}
  20. cache: 'yarn'
  21. cache-dependency-path: '**/yarn.lock'
  22. - name: Cache/Restore node_modules
  23. id: cache-dependencies
  24. uses: actions/cache@v2
  25. with:
  26. path: |
  27. **/node_modules
  28. key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
  29. restore-keys: |
  30. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
  31. - name: lerna bootstrap
  32. run: |
  33. npx lerna bootstrap -- --frozen-lockfile
  34. - name: lerna run lint for plugins
  35. run: |
  36. yarn lerna run lint --scope @growi/plugin-*
  37. - name: lerna run lint for app
  38. run: |
  39. yarn lerna run lint --scope @growi/app --scope @growi/core --scope @growi/ui
  40. - name: Slack Notification
  41. uses: weseek/ghaction-slack-notification@master
  42. if: failure()
  43. with:
  44. type: ${{ job.status }}
  45. job_name: '*Node CI for growi - lint (${{ matrix.node-version }})*'
  46. channel: '#ci'
  47. isCompactMode: true
  48. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  49. test:
  50. runs-on: ubuntu-latest
  51. strategy:
  52. matrix:
  53. node-version: [16.x]
  54. services:
  55. mongodb:
  56. image: mongo:4.4
  57. ports:
  58. - 27017/tcp
  59. steps:
  60. - uses: actions/checkout@v2
  61. - uses: actions/setup-node@v2
  62. with:
  63. node-version: ${{ matrix.node-version }}
  64. cache: 'yarn'
  65. cache-dependency-path: '**/yarn.lock'
  66. - name: Cache/Restore node_modules
  67. id: cache-dependencies
  68. uses: actions/cache@v2
  69. with:
  70. path: |
  71. **/node_modules
  72. key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
  73. restore-keys: |
  74. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
  75. - name: lerna bootstrap
  76. run: |
  77. npx lerna bootstrap -- --frozen-lockfile
  78. - name: yarn test
  79. working-directory: ./packages/app
  80. run: |
  81. yarn test
  82. env:
  83. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
  84. test-v5:
  85. runs-on: ubuntu-latest
  86. strategy:
  87. matrix:
  88. node-version: [16.x]
  89. services:
  90. mongodb:
  91. image: mongo:4.4
  92. ports:
  93. - 27017/tcp
  94. steps:
  95. - uses: actions/checkout@v2
  96. - uses: actions/setup-node@v2
  97. with:
  98. node-version: ${{ matrix.node-version }}
  99. cache: 'yarn'
  100. cache-dependency-path: '**/yarn.lock'
  101. - name: Cache/Restore node_modules
  102. id: cache-dependencies
  103. uses: actions/cache@v2
  104. with:
  105. path: |
  106. **/node_modules
  107. key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
  108. restore-keys: |
  109. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
  110. - name: lerna bootstrap
  111. run: |
  112. npx lerna bootstrap -- --frozen-lockfile
  113. - name: yarn test
  114. working-directory: ./packages/app
  115. run: |
  116. yarn test-v5
  117. env:
  118. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test_v5
  119. - name: Upload coverage report as artifact
  120. uses: actions/upload-artifact@v2
  121. with:
  122. name: Coverage Report
  123. path: packages/app/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. launch-dev:
  134. runs-on: ubuntu-latest
  135. strategy:
  136. matrix:
  137. node-version: [16.x]
  138. services:
  139. mongodb:
  140. image: mongo:4.4
  141. ports:
  142. - 27017/tcp
  143. steps:
  144. - uses: actions/checkout@v2
  145. - uses: actions/setup-node@v2
  146. with:
  147. node-version: ${{ matrix.node-version }}
  148. cache: 'yarn'
  149. cache-dependency-path: '**/yarn.lock'
  150. - name: Cache/Restore node_modules
  151. id: cache-dependencies
  152. uses: actions/cache@v2
  153. with:
  154. path: |
  155. **/node_modules
  156. key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}
  157. restore-keys: |
  158. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
  159. - name: lerna bootstrap
  160. run: |
  161. npx lerna bootstrap -- --frozen-lockfile
  162. - name: yarn dev:ci
  163. working-directory: ./packages/app
  164. run: |
  165. cp config/ci/.env.local.for-ci .env.development.local
  166. yarn dev:ci
  167. env:
  168. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_dev
  169. - name: Slack Notification
  170. uses: weseek/ghaction-slack-notification@master
  171. if: failure()
  172. with:
  173. type: ${{ job.status }}
  174. job_name: '*Node CI for growi - launch-dev (${{ matrix.node-version }})*'
  175. channel: '#ci'
  176. isCompactMode: true
  177. url: ${{ secrets.SLACK_WEBHOOK_URL }}