commitflow-frontend.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. name: Frontend CI
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request:
  7. branches:
  8. - master
  9. paths:
  10. - '**.js'
  11. - '**.jsx'
  12. - '**.ts'
  13. - '**.tsx'
  14. - '**.less'
  15. - '**.scss'
  16. - '**.vue'
  17. - 'package*.json'
  18. jobs:
  19. build:
  20. runs-on: ubuntu-20.04
  21. steps:
  22. - name: Checkout
  23. uses: actions/checkout@v3
  24. - name: Caching npm with setup node
  25. uses: actions/setup-node@v3
  26. with:
  27. node-version: 14
  28. cache: 'npm'
  29. - name: Install npm dependencies
  30. run: npm ci
  31. - name: run commit title format check
  32. run: ./tools/ci/check_for_commit_message.sh
  33. - name: run npm version checker
  34. run: npm run check-pinned-versions
  35. - name: run npm license checker
  36. run: npm run check-license
  37. - name: run npm absolute path detection
  38. run: npm run check-absolute-paths
  39. - name: run js lint
  40. run: npm run lint
  41. - name: run style lint
  42. run: npm run style-lint
  43. - name: run js tests
  44. run: |
  45. # https://jestjs.io/docs/en/troubleshooting.html#tests-are-extremely-slow-on-docker-andor-continuous-integration-ci-server
  46. sed -i 's/"test": "jest"/"test": "jest --runInBand"/g' package.json
  47. npm run test