commitflow-frontend.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. - '**commitflow-frontend.yml'
  19. jobs:
  20. build:
  21. runs-on: ubuntu-20.04
  22. steps:
  23. - name: Checkout
  24. uses: actions/checkout@v3
  25. - name: Caching npm with setup node
  26. uses: actions/setup-node@v3
  27. with:
  28. node-version: 18
  29. cache: 'npm'
  30. - name: Install npm dependencies
  31. run: npm ci
  32. - name: run commit title format check
  33. run: ./tools/ci/check_for_commit_message.sh
  34. - name: run npm version checker
  35. run: npm run check-pinned-versions
  36. - name: run npm license checker
  37. run: npm run check-license
  38. - name: run npm absolute path detection
  39. run: npm run check-absolute-paths
  40. - name: run js lint
  41. run: npm run lint
  42. - name: run style lint
  43. run: npm run style-lint
  44. - name: run js tests
  45. run: |
  46. # https://jestjs.io/docs/en/troubleshooting.html#tests-are-extremely-slow-on-docker-andor-continuous-integration-ci-server
  47. sed -i 's/"test": "jest"/"test": "jest --runInBand"/g' package.json
  48. npm run test