ci-app.yml 5.0 KB

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