ci-app.yml 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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 install
  49. - name: Lint
  50. run: |
  51. turbo run lint --filter=!@growi/slackbot-proxy
  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. ci-app-test:
  62. runs-on: ubuntu-latest
  63. strategy:
  64. matrix:
  65. node-version: [20.x]
  66. services:
  67. mongodb:
  68. image: mongo:6.0
  69. ports:
  70. - 27017/tcp
  71. steps:
  72. - uses: actions/checkout@v4
  73. - uses: pnpm/action-setup@v4
  74. - uses: actions/setup-node@v4
  75. with:
  76. node-version: ${{ matrix.node-version }}
  77. cache: 'pnpm'
  78. - name: Cache/Restore dist
  79. uses: actions/cache@v4
  80. with:
  81. path: |
  82. **/.turbo
  83. **/dist
  84. **/node_modules/.cache/turbo
  85. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  86. restore-keys: |
  87. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  88. - name: Install dependencies
  89. run: |
  90. pnpm add turbo --global
  91. pnpm install
  92. - name: Test
  93. run: |
  94. turbo run test --filter=!@growi/slackbot-proxy --env-mode=loose
  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@v4
  99. with:
  100. name: Coverage Report
  101. path: |
  102. apps/app/coverage
  103. packages/remark-growi-directive/coverage
  104. - name: Slack Notification
  105. uses: weseek/ghaction-slack-notification@master
  106. if: failure()
  107. with:
  108. type: ${{ job.status }}
  109. job_name: '*Node CI for growi - test (${{ matrix.node-version }})*'
  110. channel: '#ci'
  111. isCompactMode: true
  112. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  113. ci-app-launch-dev:
  114. runs-on: ubuntu-latest
  115. strategy:
  116. matrix:
  117. node-version: [20.x]
  118. services:
  119. mongodb:
  120. image: mongo:6.0
  121. ports:
  122. - 27017/tcp
  123. steps:
  124. - uses: actions/checkout@v4
  125. - uses: pnpm/action-setup@v4
  126. - uses: actions/setup-node@v4
  127. with:
  128. node-version: ${{ matrix.node-version }}
  129. cache: 'pnpm'
  130. - name: Cache/Restore dist
  131. uses: actions/cache@v4
  132. with:
  133. path: |
  134. **/.turbo
  135. **/dist
  136. **/node_modules/.cache/turbo
  137. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  138. restore-keys: |
  139. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  140. - name: Install dependencies
  141. run: |
  142. pnpm add turbo --global
  143. pnpm install
  144. - name: turbo run launch-dev:ci
  145. working-directory: ./apps/app
  146. run: |
  147. cp config/ci/.env.local.for-ci .env.development.local
  148. turbo run launch-dev:ci --env-mode=loose
  149. env:
  150. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_dev
  151. - name: Slack Notification
  152. uses: weseek/ghaction-slack-notification@master
  153. if: failure()
  154. with:
  155. type: ${{ job.status }}
  156. job_name: '*Node CI for growi - launch-dev (${{ matrix.node-version }})*'
  157. channel: '#ci'
  158. isCompactMode: true
  159. url: ${{ secrets.SLACK_WEBHOOK_URL }}