fe-unit-tests.yml 1016 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Workflow that runs frontend unit tests
  2. name: Run Frontend Unit Tests
  3. # * Always run on "main"
  4. # * Run on PRs that have changes in the "frontend" folder or this workflow
  5. on:
  6. push:
  7. branches:
  8. - main
  9. pull_request:
  10. paths:
  11. - 'frontend/**'
  12. - '.github/workflows/fe-unit-tests.yml'
  13. jobs:
  14. # Run frontend unit tests
  15. fe-test:
  16. name: FE Unit Tests
  17. runs-on: ubuntu-latest
  18. strategy:
  19. matrix:
  20. node-version: [20]
  21. steps:
  22. - name: Checkout
  23. uses: actions/checkout@v4
  24. - name: Set up Node.js
  25. uses: actions/setup-node@v4
  26. with:
  27. node-version: ${{ matrix.node-version }}
  28. - name: Install dependencies
  29. working-directory: ./frontend
  30. run: npm ci
  31. - name: Run tests and collect coverage
  32. working-directory: ./frontend
  33. run: npm run test:coverage
  34. - name: Upload coverage to Codecov
  35. uses: codecov/codecov-action@v4
  36. env:
  37. CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}