ci-app.yml 5.3 KB

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