webclient.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. name: webclient
  2. on:
  3. workflow_dispatch:
  4. # For now, only run on requests, not the main branches.
  5. pull_request:
  6. branches:
  7. - "*"
  8. paths:
  9. - "client/web/**"
  10. - ".github/workflows/webclient.yml"
  11. - "!**.md"
  12. # TODO(soniaappasamy): enable for main branch after an initial waiting period.
  13. #push:
  14. # branches:
  15. # - main
  16. concurrency:
  17. group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
  18. cancel-in-progress: true
  19. jobs:
  20. webclient:
  21. runs-on: ubuntu-latest
  22. steps:
  23. - name: Check out code
  24. uses: actions/checkout@v4
  25. - name: Install deps
  26. run: ./tool/yarn --cwd client/web
  27. - name: Run lint
  28. run: ./tool/yarn --cwd client/web run --silent lint
  29. - name: Run test
  30. run: ./tool/yarn --cwd client/web run --silent test
  31. - name: Run formatter check
  32. run: |
  33. ./tool/yarn --cwd client/web run --silent format-check || ( \
  34. echo "Run this command on your local device to fix the error:" && \
  35. echo "" && \
  36. echo " ./tool/yarn --cwd client/web format" && \
  37. echo "" && exit 1)