reusable-app-reg-suit.yml 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('packages/app/package.json') }}
  55. restore-keys: |
  56. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-${{ hashFiles('**/yarn.lock') }}-
  57. node_modules-${{ runner.OS }}-node${{ matrix.node-version }}-
  58. - name: lerna bootstrap
  59. run: |
  60. npx lerna bootstrap -- --frozen-lockfile
  61. - name: Download screenshots taken by cypress
  62. uses: actions/download-artifact@v2
  63. with:
  64. name: ${{ inputs.cypress-report-artifact-name }}
  65. path: packages/app/test/cypress
  66. - name: Run reg-suit
  67. working-directory: ./packages/app
  68. run: |
  69. yarn reg:run
  70. - name: Slack Notification
  71. uses: weseek/ghaction-slack-notification@master
  72. if: failure()
  73. with:
  74. type: ${{ job.status }}
  75. job_name: '*Node CI for growi - run-reg-suit (${{ inputs.node-version }})*'
  76. channel: '#ci'
  77. isCompactMode: true
  78. url: ${{ secrets.SLACK_WEBHOOK_URL }}