frontend.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. name: "Frontend: PR/master build & test"
  2. on:
  3. push:
  4. branches:
  5. - master
  6. pull_request_target:
  7. types: ["opened", "edited", "reopened", "synchronize"]
  8. paths:
  9. - "kafka-ui-contract/**"
  10. - "kafka-ui-react-app/**"
  11. permissions:
  12. checks: write
  13. pull-requests: write
  14. jobs:
  15. build-and-test:
  16. env:
  17. CI: true
  18. NODE_ENV: dev
  19. runs-on: ubuntu-latest
  20. steps:
  21. - uses: actions/checkout@v3
  22. with:
  23. # Disabling shallow clone is recommended for improving relevancy of reporting
  24. fetch-depth: 0
  25. ref: ${{ github.event.pull_request.head.sha }}
  26. - uses: pnpm/action-setup@v2.4.0
  27. with:
  28. version: 8.6.12
  29. - name: Install node
  30. uses: actions/setup-node@v3.8.1
  31. with:
  32. node-version: "18.17.1"
  33. cache: "pnpm"
  34. cache-dependency-path: "./kafka-ui-react-app/pnpm-lock.yaml"
  35. - name: Install Node dependencies
  36. run: |
  37. cd kafka-ui-react-app/
  38. pnpm install --frozen-lockfile
  39. - name: Generate sources
  40. run: |
  41. cd kafka-ui-react-app/
  42. pnpm gen:sources
  43. - name: Linter
  44. run: |
  45. cd kafka-ui-react-app/
  46. pnpm lint:CI
  47. - name: Tests
  48. run: |
  49. cd kafka-ui-react-app/
  50. pnpm test:CI
  51. - name: SonarCloud Scan
  52. uses: sonarsource/sonarcloud-github-action@master
  53. with:
  54. projectBaseDir: ./kafka-ui-react-app
  55. args: -Dsonar.pullrequest.key=${{ github.event.pull_request.number }} -Dsonar.pullrequest.branch=${{ github.head_ref }} -Dsonar.pullrequest.base=${{ github.base_ref }}
  56. env:
  57. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  58. SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_FRONTEND }}