2
0

reusable-app-reg-suit.yml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. name: Reusable build app workflow for production
  2. on:
  3. workflow_call:
  4. inputs:
  5. node-version:
  6. required: true
  7. type: string
  8. checkout-ref:
  9. type: string
  10. default: ${{ github.head_ref }}
  11. cypress-report-artifact-name:
  12. required: true
  13. type: string
  14. secrets:
  15. REG_NOTIFY_GITHUB_PLUGIN_CLIENTID:
  16. required: true
  17. AWS_ACCESS_KEY_ID:
  18. required: true
  19. AWS_SECRET_ACCESS_KEY:
  20. required: true
  21. SLACK_WEBHOOK_URL:
  22. required: true
  23. outputs:
  24. EXPECTED_IMAGES_EXIST:
  25. value: ${{ jobs.run-reg-suit.outputs.EXPECTED_IMAGES_EXIST }}
  26. jobs:
  27. run-reg-suit:
  28. # use secrets for "VRT" environment
  29. # https://github.com/weseek/growi/settings/environments/376165508/edit
  30. environment: VRT
  31. env:
  32. REG_NOTIFY_GITHUB_PLUGIN_CLIENTID: ${{ secrets.REG_NOTIFY_GITHUB_PLUGIN_CLIENTID }}
  33. AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  34. AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  35. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  36. runs-on: ubuntu-latest
  37. outputs:
  38. EXPECTED_IMAGES_EXIST: ${{ steps.check-expected-images.outputs.EXPECTED_IMAGES_EXIST }}
  39. steps:
  40. - uses: actions/checkout@v2
  41. with:
  42. ref: ${{ inputs.checkout-ref }}
  43. fetch-depth: 0
  44. - uses: actions/setup-node@v2
  45. with:
  46. node-version: ${{ inputs.node-version }}
  47. cache: 'yarn'
  48. cache-dependency-path: '**/yarn.lock'
  49. - name: Cache/Restore node_modules
  50. uses: actions/cache@v2
  51. with:
  52. path: |
  53. **/node_modules
  54. key: node_modules-${{ runner.OS }}-node${{ inputs.node-version }}-${{ hashFiles('**/yarn.lock') }}
  55. restore-keys: |
  56. node_modules-${{ runner.OS }}-node${{ inputs.node-version }}-
  57. - name: lerna bootstrap
  58. run: |
  59. npx lerna bootstrap -- --frozen-lockfile
  60. - name: Download screenshots taken by cypress
  61. uses: actions/download-artifact@v2
  62. with:
  63. name: ${{ inputs.cypress-report-artifact-name }}
  64. path: packages/app/test/cypress
  65. - name: Run reg-suit
  66. working-directory: ./packages/app
  67. run: |
  68. yarn reg:run
  69. - name: Slack Notification
  70. uses: weseek/ghaction-slack-notification@master
  71. if: failure()
  72. with:
  73. type: ${{ job.status }}
  74. job_name: '*Node CI for growi - run-reg-suit (${{ inputs.node-version }})*'
  75. channel: '#ci'
  76. isCompactMode: true
  77. url: ${{ secrets.SLACK_WEBHOOK_URL }}