Merge pull request #89 from AnuKritiW/docs/cleanup #63
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: Run Unit Tests | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'src/**' # app code | |
| - 'public/**' # static assets | |
| - 'index.html' # Vite entry | |
| - 'vite.config.ts' # build config | |
| - 'package.json' # deps/scripts can change output | |
| - 'package-lock.json' # lockfile updates can change output | |
| - 'tsconfig*.json' # TS config may affect build | |
| - 'tests/**' # tests change | |
| pull_request: | |
| types: [opened, synchronize, ready_for_review] | |
| branches: [main] | |
| paths: | |
| - 'src/**' # app code | |
| - 'public/**' # static assets | |
| - 'index.html' # Vite entry | |
| - 'vite.config.ts' # build config | |
| - 'package.json' # deps/scripts can change output | |
| - 'package-lock.json' # lockfile updates can change output | |
| - 'tsconfig*.json' # TS config may affect build | |
| - 'tests/**' # tests change | |
| workflow_dispatch: {} # manual run when needed | |
| # auto-cancels older runs if new commits are pushed to the same PR | |
| concurrency: | |
| group: tests-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || format('ref-{0}', github.ref) }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| if: github.event_name != 'pull_request' || github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| shard: ['1/2','2/2'] | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run unit tests (shard ${{ matrix.shard }}) | |
| run: npx vitest run tests --shard ${{ matrix.shard }} |