ci-app.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. - support/apply-nextjs-2
  10. paths:
  11. - .github/workflows/ci-app.yml
  12. - .eslint*
  13. - tsconfig.base.json
  14. - yarn.lock
  15. - packages/app/**
  16. - '!packages/app/docker/**'
  17. - packages/core/**
  18. - packages/slack/**
  19. - packages/ui/**
  20. - packages/plugin-*/**
  21. jobs:
  22. lint:
  23. runs-on: ubuntu-latest
  24. strategy:
  25. matrix:
  26. node-version: [16.x]
  27. steps:
  28. - uses: actions/checkout@v3
  29. - uses: actions/setup-node@v3
  30. with:
  31. node-version: ${{ matrix.node-version }}
  32. cache: 'yarn'
  33. cache-dependency-path: '**/yarn.lock'
  34. - name: Cache/Restore node_modules
  35. id: cache-dependencies
  36. uses: actions/cache@v3
  37. with:
  38. path: |
  39. **/node_modules
  40. key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
  41. restore-keys: |
  42. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
  43. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
  44. - name: lerna bootstrap
  45. run: |
  46. npx lerna bootstrap -- --frozen-lockfile
  47. - name: lerna run lint for plugins
  48. run: |
  49. yarn lerna run lint --scope @growi/plugin-*
  50. - name: lerna run lint for app
  51. run: |
  52. yarn lerna run lint --scope @growi/app --scope @growi/codemirror-textlint --scope @growi/core --scope @growi/ui
  53. - name: Slack Notification
  54. uses: weseek/ghaction-slack-notification@master
  55. if: failure()
  56. with:
  57. type: ${{ job.status }}
  58. job_name: '*Node CI for growi - lint (${{ matrix.node-version }})*'
  59. channel: '#ci'
  60. isCompactMode: true
  61. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  62. test:
  63. runs-on: ubuntu-latest
  64. strategy:
  65. matrix:
  66. node-version: [16.x]
  67. services:
  68. mongodb:
  69. image: mongo:4.4
  70. ports:
  71. - 27017/tcp
  72. steps:
  73. - uses: actions/checkout@v3
  74. - uses: actions/setup-node@v3
  75. with:
  76. node-version: ${{ matrix.node-version }}
  77. cache: 'yarn'
  78. cache-dependency-path: '**/yarn.lock'
  79. - name: Cache/Restore node_modules
  80. id: cache-dependencies
  81. uses: actions/cache@v3
  82. with:
  83. path: |
  84. **/node_modules
  85. key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
  86. restore-keys: |
  87. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
  88. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
  89. - name: lerna bootstrap
  90. run: |
  91. npx lerna bootstrap -- --frozen-lockfile
  92. - name: yarn test
  93. working-directory: ./packages/app
  94. run: |
  95. yarn test:ci --selectProjects unit server ; yarn test:ci --selectProjects server-v5
  96. env:
  97. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
  98. - name: Upload coverage report as artifact
  99. uses: actions/upload-artifact@v3
  100. with:
  101. name: Coverage Report
  102. path: packages/app/coverage
  103. - name: Slack Notification
  104. uses: weseek/ghaction-slack-notification@master
  105. if: failure()
  106. with:
  107. type: ${{ job.status }}
  108. job_name: '*Node CI for growi - test (${{ matrix.node-version }})*'
  109. channel: '#ci'
  110. isCompactMode: true
  111. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  112. launch-dev:
  113. runs-on: ubuntu-latest
  114. strategy:
  115. matrix:
  116. node-version: [16.x]
  117. services:
  118. mongodb:
  119. image: mongo:4.4
  120. ports:
  121. - 27017/tcp
  122. steps:
  123. - uses: actions/checkout@v3
  124. - uses: actions/setup-node@v3
  125. with:
  126. node-version: ${{ matrix.node-version }}
  127. cache: 'yarn'
  128. cache-dependency-path: '**/yarn.lock'
  129. - name: Cache/Restore node_modules
  130. id: cache-dependencies
  131. uses: actions/cache@v3
  132. with:
  133. path: |
  134. **/node_modules
  135. key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
  136. restore-keys: |
  137. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
  138. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
  139. - name: lerna bootstrap
  140. run: |
  141. npx lerna bootstrap -- --frozen-lockfile
  142. - name: yarn dev:ci
  143. working-directory: ./packages/app
  144. run: |
  145. cp config/ci/.env.local.for-ci .env.development.local
  146. yarn dev:ci
  147. env:
  148. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_dev
  149. - name: Slack Notification
  150. uses: weseek/ghaction-slack-notification@master
  151. if: failure()
  152. with:
  153. type: ${{ job.status }}
  154. job_name: '*Node CI for growi - launch-dev (${{ matrix.node-version }})*'
  155. channel: '#ci'
  156. isCompactMode: true
  157. url: ${{ secrets.SLACK_WEBHOOK_URL }}