reusable-app-reg-suit.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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:
  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@v3
  44. with:
  45. ref: ${{ inputs.checkout-ref }}
  46. fetch-depth: 0
  47. - uses: actions/setup-node@v3
  48. with:
  49. node-version: ${{ inputs.node-version }}
  50. cache: 'yarn'
  51. cache-dependency-path: '**/yarn.lock'
  52. - name: Cache/Restore node_modules
  53. uses: actions/cache@v3
  54. with:
  55. path: |
  56. **/node_modules
  57. key: node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
  58. restore-keys: |
  59. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
  60. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
  61. - name: lerna bootstrap
  62. run: |
  63. npx lerna bootstrap -- --frozen-lockfile
  64. - name: Download screenshots taken by cypress
  65. uses: actions/download-artifact@v3
  66. with:
  67. name: ${{ inputs.cypress-report-artifact-name }}
  68. path: packages/app/test/cypress
  69. - name: Run reg-suit
  70. working-directory: ./packages/app
  71. run: |
  72. yarn reg:run
  73. - name: Slack Notification
  74. uses: weseek/ghaction-slack-notification@master
  75. if: failure()
  76. with:
  77. type: ${{ job.status }}
  78. job_name: '*Node CI for growi - run-reg-suit (${{ inputs.node-version }})*'
  79. channel: '#ci'
  80. isCompactMode: true
  81. url: ${{ secrets.SLACK_WEBHOOK_URL }}