Merge pull request #4 from chamika/add-tests #3
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, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| jobs: | |
| frontend: | |
| name: Frontend CI | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Sync SvelteKit | |
| run: npx svelte-kit sync | |
| - name: Check Types | |
| run: npm run check | |
| - name: Lint | |
| run: npm run lint | |
| - name: Unit Tests | |
| run: npm run test:unit | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: E2E Tests | |
| run: npm run test:e2e | |
| - name: Build | |
| run: npm run build | |
| worker: | |
| name: Worker CI | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: worker | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: worker/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build | |
| run: npx wrangler deploy --dry-run --outdir=dist |