Install Playwrigh during CI #17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ main ] | |
| tags: | |
| - 'v*' | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20.x, 22.x] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| # Fix npm bug with optional dependencies | |
| # see: https://github.com/hydephp/hyde/issues/289 | |
| - name: Remove node_modules and package-lock.json | |
| run: rm -rf node_modules package-lock.json | |
| - name: Clear npm cache | |
| run: npm cache clean --force | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run Unit tests | |
| run: npm test | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Run Playwright tests | |
| run: npm run test:e2e |