123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- name: js build and lint
- on:
-
-
- push:
- branches:
- - master
- pull_request:
- jobs:
- typescript-and-lint:
- name: typescript and lint
- if: github.ref != 'refs/heads/master'
- runs-on: ubuntu-16.04
- steps:
- - uses: actions/checkout@v2
- with:
-
-
- ref: ${{ github.event.pull_request.head.ref || 'master' }}
-
- repository: ${{ github.event.pull_request.head.repo.full_name }}
- - name: Check for frontend file changes
- uses: getsentry/paths-filter@v2
- id: changes
- with:
- list-files: shell
- token: ${{ github.token }}
- filters: .github/file-filters.yml
- - uses: volta-cli/action@v1
- if: steps.changes.outputs.frontend == 'true'
-
- - name: Get yarn cache directory path
- id: yarn-cache-dir-path
- if: steps.changes.outputs.frontend == 'true'
- run: echo "::set-output name=dir::$(yarn cache dir)"
- - uses: actions/cache@v2
- id: yarn-cache
- if: steps.changes.outputs.frontend == 'true'
- with:
- path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-yarn-
- - name: Install dependencies
- if: steps.changes.outputs.frontend == 'true'
- run: yarn install
-
- - name: setup matchers
- id: matchers
- if: steps.changes.outputs.frontend == 'true'
- run: |
- echo "::remove-matcher owner=masters::"
- echo "::add-matcher::.github/tsc.json"
- echo "::add-matcher::.github/eslint-stylish.json"
-
- - name: eslint
- if: github.ref == 'refs/heads/master' && steps.changes.outputs.frontend == 'true'
- run: |
-
- yarn lint -c .eslintrc.relax.js
- yarn lint:css
- - name: eslint (forks)
- if: github.ref != 'refs/heads/master' && steps.changes.outputs.frontend == 'true' && github.event.pull_request.head.repo.full_name != github.repository
- run: |
- yarn eslint ${{ steps.changes.outputs.frontend_modified_lintable_files }}
-
- - name: eslint (changed files only)
- if: github.ref != 'refs/heads/master' && steps.changes.outputs.frontend == 'true' && github.event.pull_request.head.repo.full_name == github.repository
- run: |
- yarn eslint
-
- - name: Commit any eslint fixed files
- if: github.ref != 'refs/heads/master' && steps.changes.outputs.frontend == 'true' && github.event.pull_request.head.repo.full_name == github.repository
- continue-on-error: true
- run: |
- git config
- git config
- git add -A
- git commit -m "chore: Automatic eslint fix (${GITHUB_SHA})" || exit 0
- git push origin
- - name: tsc
- if: always() && steps.changes.outputs.frontend == 'true'
- run: |
- yarn tsc -p config/tsconfig.build.json
- - name: storybook
- if: steps.changes.outputs.frontend == 'true'
- env:
- STORYBOOK_BUILD: 1
- run: |
- yarn storybook-build
- webpack:
- runs-on: ubuntu-16.04
- steps:
- - uses: actions/checkout@v2
- - name: Check for frontend file changes
- uses: getsentry/paths-filter@v2
- id: changes
- with:
- token: ${{ github.token }}
- filters: .github/file-filters.yml
- - uses: volta-cli/action@v1
- if: github.ref == 'refs/heads/master' || steps.changes.outputs.frontend == 'true'
-
- - name: Get yarn cache directory path
- id: yarn-cache-dir-path
- if: github.ref == 'refs/heads/master' || steps.changes.outputs.frontend == 'true'
- run: echo "::set-output name=dir::$(yarn cache dir)"
- - uses: actions/cache@v2
- id: yarn-cache
- if: github.ref == 'refs/heads/master' || steps.changes.outputs.frontend == 'true'
- with:
- path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-yarn-
- - name: Install dependencies
- if: github.ref == 'refs/heads/master' || steps.changes.outputs.frontend == 'true'
- run: yarn install
- - uses: getsentry/size-limit-action@v3
- if: github.ref == 'refs/heads/master' || steps.changes.outputs.frontend == 'true'
- env:
- SENTRY_INSTRUMENTATION: 1
- SENTRY_WEBPACK_WEBHOOK_SECRET: ${{ secrets.SENTRY_WEBPACK_WEBHOOK_SECRET }}
- with:
- main_branch: master
- workflow_name: 'js-build-and-lint'
- skip_step: install
- build_script: build
- windows_verbatim_arguments: false
- github_token: ${{ secrets.GITHUB_TOKEN }}
|