ci-slackbot-proxy.yml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. name: Node CI for slackbot-proxy
  2. on:
  3. push:
  4. branches-ignore:
  5. - release/**
  6. - rc/**
  7. - tmp/**
  8. jobs:
  9. test:
  10. runs-on: ubuntu-latest
  11. strategy:
  12. matrix:
  13. node-version: [14.x]
  14. steps:
  15. - uses: actions/checkout@v2
  16. - uses: actions/setup-node@v2
  17. with:
  18. node-version: ${{ matrix.node-version }}
  19. cache: 'yarn'
  20. cache-dependency-path: '**/yarn.lock'
  21. - name: lerna bootstrap
  22. run: |
  23. npx lerna bootstrap
  24. - name: Print dependencies
  25. run: |
  26. echo -n "node " && node -v
  27. echo -n "npm " && npm -v
  28. yarn list --depth=0
  29. - name: yarn lint
  30. run: |
  31. yarn lerna run lint --scope @growi/slack --scope @growi/slackbot-proxy
  32. - name: yarn test
  33. run: |
  34. yarn lerna run test --scope @growi/slack --scope @growi/slackbot-proxy
  35. - name: Slack Notification
  36. uses: weseek/ghaction-slack-notification@master
  37. if: failure()
  38. with:
  39. type: ${{ job.status }}
  40. job_name: '*Node CI for growi-bot-proxy - test (${{ matrix.node-version }})*'
  41. channel: '#ci'
  42. isCompactMode: true
  43. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  44. launch-dev:
  45. runs-on: ubuntu-latest
  46. strategy:
  47. matrix:
  48. node-version: [14.x]
  49. services:
  50. mysql:
  51. image: mysql:8.0
  52. ports:
  53. - 3306
  54. options: --health-cmd "mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 3
  55. env:
  56. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  57. MYSQL_DATABASE: growi-slackbot-proxy
  58. steps:
  59. - uses: actions/checkout@v2
  60. - uses: actions/setup-node@v2
  61. with:
  62. node-version: ${{ matrix.node-version }}
  63. cache: 'yarn'
  64. cache-dependency-path: '**/yarn.lock'
  65. - name: lerna bootstrap
  66. run: |
  67. npx lerna bootstrap
  68. - name: Print dependencies
  69. run: |
  70. echo -n "node " && node -v
  71. echo -n "npm " && npm -v
  72. yarn list --depth=0
  73. - name: yarn dev:ci
  74. working-directory: ./packages/slackbot-proxy
  75. run: |
  76. cp config/ci/.env.local.for-ci .env.development.local
  77. yarn dev:ci
  78. env:
  79. TYPEORM_CONNECTION: mysql
  80. TYPEORM_HOST: localhost
  81. TYPEORM_PORT: ${{ job.services.mysql.ports[3306] }}
  82. TYPEORM_DATABASE: growi-slackbot-proxy
  83. TYPEORM_USERNAME: root
  84. TYPEORM_PASSWORD:
  85. - name: Slack Notification
  86. uses: weseek/ghaction-slack-notification@master
  87. if: failure()
  88. with:
  89. type: ${{ job.status }}
  90. job_name: '*Node CI for growi-bot-proxy - launch-dev (${{ matrix.node-version }})*'
  91. channel: '#ci'
  92. isCompactMode: true
  93. url: ${{ secrets.SLACK_WEBHOOK_URL }}
  94. launch-prod:
  95. runs-on: ubuntu-latest
  96. strategy:
  97. matrix:
  98. node-version: [14.x]
  99. services:
  100. mysql:
  101. image: mysql:8.0
  102. ports:
  103. - 3306
  104. options: --health-cmd "mysqladmin ping" --health-interval 5s --health-timeout 2s --health-retries 3
  105. env:
  106. MYSQL_ALLOW_EMPTY_PASSWORD: yes
  107. MYSQL_DATABASE: growi-slackbot-proxy
  108. steps:
  109. - uses: actions/checkout@v2
  110. - uses: actions/setup-node@v2
  111. with:
  112. node-version: ${{ matrix.node-version }}
  113. cache: 'yarn'
  114. cache-dependency-path: '**/yarn.lock'
  115. - name: lerna bootstrap
  116. run: |
  117. npx lerna bootstrap
  118. - name: Print dependencies
  119. run: |
  120. echo -n "node " && node -v
  121. echo -n "npm " && npm -v
  122. yarn list --depth=0
  123. - name: lerna run build
  124. run: |
  125. yarn lerna run build --scope @growi/slack --scope @growi/slackbot-proxy
  126. - name: lerna bootstrap --production
  127. run: |
  128. npx lerna bootstrap -- --production
  129. - name: Print dependencies
  130. run: |
  131. echo -n "node " && node -v
  132. echo -n "npm " && npm -v
  133. yarn list --production --depth=0
  134. - name: yarn start:prod:ci
  135. working-directory: ./packages/slackbot-proxy
  136. run: |
  137. cp config/ci/.env.local.for-ci .env.production.local
  138. yarn start:prod:ci
  139. env:
  140. TYPEORM_CONNECTION: mysql
  141. TYPEORM_HOST: localhost
  142. TYPEORM_PORT: ${{ job.services.mysql.ports[3306] }}
  143. TYPEORM_DATABASE: growi-slackbot-proxy
  144. TYPEORM_USERNAME: root
  145. TYPEORM_PASSWORD:
  146. - name: Upload report as artifact
  147. uses: actions/upload-artifact@v2
  148. with:
  149. name: Report
  150. path: report
  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-bot-proxy - launch-prod (${{ matrix.node-version }})*'
  157. channel: '#ci'
  158. isCompactMode: true
  159. url: ${{ secrets.SLACK_WEBHOOK_URL }}