playwright.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. name: Playwright Tests
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. pull_request:
  7. paths:
  8. - 'preview/**'
  9. - 'core/**'
  10. env:
  11. NODE: 20
  12. permissions:
  13. contents: read
  14. jobs:
  15. test:
  16. timeout-minutes: 60
  17. runs-on: ubuntu-latest
  18. steps:
  19. - name: Clone repository
  20. uses: actions/checkout@v4
  21. - name: Cache turbo build setup
  22. uses: actions/cache@v4
  23. with:
  24. path: .turbo
  25. key: ${{ runner.os }}-turbo-${{ github.sha }}
  26. restore-keys: |
  27. ${{ runner.os }}-turbo-
  28. - name: Set up Node.js
  29. uses: actions/setup-node@v4
  30. with:
  31. node-version: "${{ env.NODE }}"
  32. - name: Install PNPM
  33. uses: pnpm/action-setup@v4
  34. - name: Get installed Playwright version
  35. id: playwright-version
  36. run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@playwright/test'])")" >> $GITHUB_ENV
  37. - name: Cache playwright binaries
  38. uses: actions/cache@v4
  39. id: playwright-cache
  40. with:
  41. path: |
  42. ~/.cache/ms-playwright
  43. key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
  44. - name: Install pnpm dependencies
  45. run: pnpm install
  46. - name: Install Playwright Browsers
  47. run: pnpm exec playwright install --with-deps
  48. if: steps.playwright-cache.outputs.cache-hit != 'true'
  49. - name: Run Playwright tests
  50. run: pnpm run playwright