web-tests.yml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. # to run pnpm, should install package canvas, but it always install failed on amd64 under ubuntu-latest
  30. # - name: Install pnpm
  31. # uses: pnpm/action-setup@v4
  32. # with:
  33. # version: 10
  34. # run_install: false
  35. # - name: Setup Node.js
  36. # uses: actions/setup-node@v4
  37. # if: steps.changed-files.outputs.any_changed == 'true'
  38. # with:
  39. # node-version: 20
  40. # cache: pnpm
  41. # cache-dependency-path: ./web/package.json
  42. # - name: Install dependencies
  43. # if: steps.changed-files.outputs.any_changed == 'true'
  44. # run: pnpm install --frozen-lockfile
  45. # - name: Run tests
  46. # if: steps.changed-files.outputs.any_changed == 'true'
  47. # run: pnpm test