web-tests.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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: Setup Node.js
  30. uses: actions/setup-node@v4
  31. if: steps.changed-files.outputs.any_changed == 'true'
  32. with:
  33. node-version: 20
  34. cache: pnpm
  35. cache-dependency-path: ./web/package.json
  36. - name: Install dependencies
  37. if: steps.changed-files.outputs.any_changed == 'true'
  38. run: pnpm install --frozen-lockfile
  39. - name: Run tests
  40. if: steps.changed-files.outputs.any_changed == 'true'
  41. run: pnpm test