Setup Playwright as E2E test framework #442
Workflow file for this run
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: Test | |
| on: | |
| push: | |
| paths-ignore: | |
| - '**.md' | |
| pull_request: | |
| paths-ignore: | |
| - '**.md' | |
| env: | |
| CI: true | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Use Node.js 22.x | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22.x | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: TypeScript check | |
| run: pnpm type-check | |
| - name: Eslint check | |
| run: pnpm lint | |
| unit_test: | |
| name: Unit test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Use Node.js 22.x | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22.x | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Unit test | |
| run: pnpm test:unit | |
| - name: Update coverage report | |
| uses: codecov/codecov-action@v5 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| cypress_e2e_tests: | |
| name: Cypress E2E test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Use Node.js 22.x | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version: 22.x | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Get cypress version | |
| id: cypress-version | |
| run: echo "version=$(pnpm info cypress version)" >> $GITHUB_OUTPUT | |
| - name: Cache cypress binary | |
| id: cache-cypress-binary | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/Cypress | |
| key: cypress-binary-${{ runner.os }}-${{ steps.cypress-version.outputs.version }} | |
| - name: Install cypress binary | |
| if: steps.cache-cypress-binary.outputs.cache-hit != 'true' | |
| run: pnpm cypress install | |
| - name: E2E test | |
| run: pnpm test:cypress | |
| playwright_e2e_tests: | |
| name: Playwright E2E test | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| container: | |
| image: mcr.microsoft.com/playwright:v1.55.1-noble | |
| options: --user 1001 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Use Node.js 22.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.x | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Install playwright binary | |
| run: pnpm playwright install --with-deps | |
| - name: E2E test | |
| run: pnpm test:playwright | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 |