javascript.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. name: javascript
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. paths:
  8. - '**.[tj]sx?'
  9. - package.json
  10. - yarn.lock
  11. jobs:
  12. getsentry:
  13. if: ${{ github.ref != 'refs/heads/master' }}
  14. runs-on: ubuntu-16.04
  15. steps:
  16. - name: getsentry token
  17. id: getsentry
  18. uses: getsentry/action-github-app-token@v1
  19. with:
  20. app_id: ${{ secrets.SENTRY_INTERNAL_APP_ID }}
  21. private_key: ${{ secrets.SENTRY_INTERNAL_APP_PRIVATE_KEY }}
  22. # Notify getsentry
  23. - name: Dispatch getsentry tests
  24. uses: actions/github-script@v3
  25. with:
  26. github-token: ${{ steps.getsentry.outputs.token }}
  27. script: |
  28. github.actions.createWorkflowDispatch({
  29. owner: 'getsentry',
  30. repo: 'getsentry',
  31. workflow_id: 'javascript.yml',
  32. ref: 'master',
  33. inputs: {
  34. 'sentry-sha': '${{ github.event.pull_request.head.sha }}',
  35. }
  36. })
  37. build:
  38. name: lint and typescript
  39. if: ${{ github.ref != 'refs/heads/master' }}
  40. runs-on: ubuntu-16.04
  41. steps:
  42. # Checkout codebase
  43. - uses: actions/checkout@v2
  44. # Install/setup node
  45. - uses: volta-cli/action@v1
  46. # See https://github.com/actions/cache/blob/master/examples.md#node---yarn for example
  47. - name: Get yarn cache directory path
  48. id: yarn-cache-dir-path
  49. run: echo "::set-output name=dir::$(yarn cache dir)"
  50. # yarn cache
  51. - uses: actions/cache@v1
  52. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  53. with:
  54. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  55. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  56. restore-keys: |
  57. ${{ runner.os }}-yarn-
  58. - name: Install dependencies
  59. run: yarn install --frozen-lockfile
  60. - name: eslint + fix
  61. uses: getsentry/action-eslint-fix@master
  62. with:
  63. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  64. # Setup custom tsc matcher, see https://github.com/actions/setup-node/issues/97
  65. - name: tsc
  66. id: tsc
  67. if: always()
  68. run: |
  69. echo "::remove-matcher owner=tsc::"
  70. echo "::add-matcher::.github/tsc.json"
  71. yarn tsc -p config/tsconfig.build.json
  72. webpack:
  73. runs-on: ubuntu-16.04
  74. steps:
  75. # Checkout codebase
  76. - uses: actions/checkout@v2
  77. # Install/setup node
  78. - uses: volta-cli/action@v1
  79. # See https://github.com/actions/cache/blob/master/examples.md#node---yarn for example
  80. - name: Get yarn cache directory path
  81. id: yarn-cache-dir-path
  82. run: echo "::set-output name=dir::$(yarn cache dir)"
  83. # yarn cache
  84. - uses: actions/cache@v1
  85. id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
  86. with:
  87. path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
  88. key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
  89. restore-keys: |
  90. ${{ runner.os }}-yarn-
  91. - name: Install dependencies
  92. run: yarn install --frozen-lockfile
  93. - uses: getsentry/size-limit-action@v1-dev
  94. with:
  95. main_branch: master
  96. skip_step: install
  97. build_script: build
  98. windows_verbatim_arguments: false
  99. github_token: ${{ secrets.GITHUB_TOKEN }}