2
0

ci-slackbot-proxy.yml 4.8 KB

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