ci-app.yml 5.0 KB

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