ci-app.yml 5.4 KB

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