web-tests.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Web Tests
  2. on:
  3. pull_request:
  4. branches:
  5. - main
  6. paths:
  7. - web/**
  8. concurrency:
  9. group: web-tests-${{ github.head_ref || github.run_id }}
  10. cancel-in-progress: true
  11. jobs:
  12. test:
  13. name: Web Tests
  14. runs-on: ubuntu-latest
  15. defaults:
  16. run:
  17. working-directory: ./web
  18. steps:
  19. - name: Checkout code
  20. uses: actions/checkout@v4
  21. with:
  22. fetch-depth: 0
  23. persist-credentials: false
  24. - name: Check changed files
  25. id: changed-files
  26. uses: tj-actions/changed-files@v45
  27. with:
  28. files: web/**
  29. - name: Install pnpm
  30. uses: pnpm/action-setup@v4
  31. with:
  32. version: 10
  33. run_install: false
  34. - name: Setup Node.js
  35. uses: actions/setup-node@v4
  36. if: steps.changed-files.outputs.any_changed == 'true'
  37. with:
  38. node-version: 20
  39. cache: pnpm
  40. cache-dependency-path: ./web/package.json
  41. - name: Install dependencies
  42. if: steps.changed-files.outputs.any_changed == 'true'
  43. run: pnpm install --frozen-lockfile
  44. - name: Run tests
  45. if: steps.changed-files.outputs.any_changed == 'true'
  46. run: pnpm test