chore: move tests #205
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 | |
| pull_request: | |
| branches: | |
| - main | |
| # https://github.com/vitejs/vite/blob/main/.github/workflows/ci.yml | |
| env: | |
| # 7 GiB by default on GitHub, setting to 6 GiB | |
| # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources | |
| NODE_OPTIONS: --max-old-space-size=6144 | |
| # Remove default permissions of GITHUB_TOKEN for security | |
| # https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs | |
| permissions: {} | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.number || github.sha }} | |
| cancel-in-progress: ${{ github.event_name != 'push' }} | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - run: corepack enable | |
| - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | |
| with: | |
| node-version: lts/* | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build | |
| run: pnpm build | |
| - name: Format check | |
| run: pnpm format | |
| - name: Lint | |
| run: pnpm lint | |
| - name: Knip | |
| run: pnpm knip | |
| - name: Check engine ranges, peer dependency ranges and installed versions | |
| run: pnpm test:engines | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - run: corepack enable | |
| - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | |
| with: | |
| node-version: lts/* | |
| cache: 'pnpm' | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Install Playwright | |
| run: pnpm playwright-core install chromium | |
| - name: Build module | |
| run: pnpm build && pnpm install | |
| - name: Run unit tests | |
| run: pnpm test:unit | |
| - name: Test examples | |
| run: pnpm test:e2e |