reusable-app-reg-suit.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. 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/weseek/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: actions/setup-node@v4
  48. with:
  49. node-version: ${{ inputs.node-version }}
  50. cache: 'yarn'
  51. cache-dependency-path: '**/yarn.lock'
  52. - name: Restore node_modules
  53. uses: actions/cache/restore@v4
  54. with:
  55. path: |
  56. **/node_modules
  57. # shared key with ci-app.yml
  58. key: node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.head_ref || github.ref_name }}-${{ hashFiles('**/yarn.lock') }}
  59. restore-keys: |
  60. node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-${{ github.head_ref || github.ref_name }}-
  61. node_modules-ci-app-${{ runner.OS }}-node${{ inputs.node-version }}-
  62. - name: Install dependencies
  63. run: |
  64. yarn global add node-gyp
  65. yarn --frozen-lockfile
  66. - name: Download screenshots taken by cypress
  67. uses: actions/download-artifact@v4
  68. with:
  69. path: apps/app/test/cypress
  70. pattern: ${{ inputs.cypress-report-artifact-name-pattern }}
  71. merge-multiple: true
  72. - name: Run reg-suit
  73. working-directory: ./apps/app
  74. run: |
  75. yarn reg:run
  76. - name: Slack Notification
  77. uses: weseek/ghaction-slack-notification@master
  78. if: failure()
  79. with:
  80. type: ${{ job.status }}
  81. job_name: '*Node CI for growi - run-reg-suit (${{ inputs.node-version }})*'
  82. channel: '#ci'
  83. isCompactMode: true
  84. url: ${{ secrets.SLACK_WEBHOOK_URL }}