ci-app.yml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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: [20.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. services:
  82. mongodb:
  83. image: mongo:6.0
  84. ports:
  85. - 27017/tcp
  86. steps:
  87. - uses: actions/checkout@v4
  88. - uses: pnpm/action-setup@v4
  89. - uses: actions/setup-node@v4
  90. with:
  91. node-version: ${{ matrix.node-version }}
  92. cache: 'pnpm'
  93. - name: Cache/Restore dist
  94. uses: actions/cache@v4
  95. with:
  96. path: |
  97. **/.turbo
  98. **/dist
  99. **/node_modules/.cache/turbo
  100. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  101. restore-keys: |
  102. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  103. - name: Install dependencies
  104. run: |
  105. pnpm add turbo --global
  106. pnpm install --frozen-lockfile
  107. - name: Test
  108. run: |
  109. turbo run test --filter=@growi/app --filter=./packages/* --env-mode=loose
  110. env:
  111. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
  112. - name: Upload coverage report as artifact
  113. uses: actions/upload-artifact@v4
  114. with:
  115. name: Coverage Report
  116. path: |
  117. apps/app/coverage
  118. packages/remark-growi-directive/coverage
  119. - name: Slack Notification
  120. uses: weseek/ghaction-slack-notification@master
  121. if: failure()
  122. with:
  123. type: ${{ job.status }}
  124. job_name: '*Node CI for growi - test (${{ matrix.node-version }})*'
  125. channel: '#ci'
  126. isCompactMode: true
  127. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  128. ci-app-launch-dev:
  129. runs-on: ubuntu-latest
  130. strategy:
  131. matrix:
  132. node-version: [20.x]
  133. services:
  134. mongodb:
  135. image: mongo:6.0
  136. ports:
  137. - 27017/tcp
  138. steps:
  139. - uses: actions/checkout@v4
  140. - uses: pnpm/action-setup@v4
  141. - uses: actions/setup-node@v4
  142. with:
  143. node-version: ${{ matrix.node-version }}
  144. cache: 'pnpm'
  145. - name: Cache/Restore dist
  146. uses: actions/cache@v4
  147. with:
  148. path: |
  149. **/.turbo
  150. **/dist
  151. **/node_modules/.cache/turbo
  152. key: dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-${{ github.sha }}
  153. restore-keys: |
  154. dist-ci-app-${{ runner.OS }}-node${{ matrix.node-version }}-
  155. - name: Install dependencies
  156. run: |
  157. pnpm add turbo --global
  158. pnpm install --frozen-lockfile
  159. - name: turbo run launch-dev:ci
  160. working-directory: ./apps/app
  161. run: |
  162. cp config/ci/.env.local.for-ci .env.development.local
  163. turbo run launch-dev:ci --env-mode=loose
  164. env:
  165. MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_dev
  166. - name: Slack Notification
  167. uses: weseek/ghaction-slack-notification@master
  168. if: failure()
  169. with:
  170. type: ${{ job.status }}
  171. job_name: '*Node CI for growi - launch-dev (${{ matrix.node-version }})*'
  172. channel: '#ci'
  173. isCompactMode: true
  174. url: ${{ secrets.SLACK_WEBHOOK_URL }}