ci-app.yml 5.1 KB

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