ci-app.yml 5.2 KB

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