reusable-app-reg-suit.yml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. name: Reusable VRT reporting 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. skip-reg-suit:
  12. type: boolean
  13. cypress-report-artifact-name-pattern:
  14. required: true
  15. type: string
  16. secrets:
  17. REG_NOTIFY_GITHUB_PLUGIN_CLIENTID:
  18. required: true
  19. AWS_ACCESS_KEY_ID:
  20. required: true
  21. AWS_SECRET_ACCESS_KEY:
  22. required: true
  23. SLACK_WEBHOOK_URL:
  24. required: true
  25. outputs:
  26. EXPECTED_IMAGES_EXIST:
  27. value: ${{ jobs.run-reg-suit.outputs.EXPECTED_IMAGES_EXIST }}
  28. jobs:
  29. run-reg-suit:
  30. # use secrets for "VRT" environment
  31. # https://github.com/growilabs/growi/settings/environments/376165508/edit
  32. environment: VRT
  33. if: ${{ !inputs.skip-reg-suit }}
  34. env:
  35. REG_NOTIFY_GITHUB_PLUGIN_CLIENTID: ${{ secrets.REG_NOTIFY_GITHUB_PLUGIN_CLIENTID }}
  36. AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
  37. AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  38. SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  39. runs-on: ubuntu-latest
  40. outputs:
  41. EXPECTED_IMAGES_EXIST: ${{ steps.check-expected-images.outputs.EXPECTED_IMAGES_EXIST }}
  42. steps:
  43. - uses: actions/checkout@v4
  44. with:
  45. ref: ${{ inputs.checkout-ref }}
  46. fetch-depth: 0
  47. - uses: pnpm/action-setup@v4
  48. - uses: actions/setup-node@v4
  49. with:
  50. node-version: ${{ inputs.node-version }}
  51. cache: 'pnpm'
  52. - name: Install dependencies
  53. run: |
  54. pnpm install --frozen-lockfile
  55. - name: Download screenshots taken by cypress
  56. uses: actions/download-artifact@v4
  57. with:
  58. path: apps/app/test/cypress
  59. pattern: ${{ inputs.cypress-report-artifact-name-pattern }}
  60. merge-multiple: true
  61. - name: Run reg-suit
  62. working-directory: ./apps/app
  63. run: |
  64. pnpm run reg:run
  65. - name: Slack Notification
  66. uses: weseek/ghaction-slack-notification@master
  67. if: failure()
  68. with:
  69. type: ${{ job.status }}
  70. job_name: '*Node CI for growi - run-reg-suit (${{ inputs.node-version }})*'
  71. channel: '#ci'
  72. isCompactMode: true
  73. url: ${{ secrets.SLACK_WEBHOOK_URL }}