feat(): Last step for project modernization #8
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: [dev, master] | |
| pull_request: | |
| branches: [dev, master] | |
| # Cancel superseded runs on the same branch / PR. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| unit: | |
| name: Unit tests (Vitest) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: npm | |
| - run: npm ci | |
| - run: npm test | |
| build-and-e2e: | |
| name: Build wasm + JS, run Playwright | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: npm | |
| - uses: mymindstorm/setup-emsdk@v14 | |
| with: | |
| version: 3.1.61 | |
| actions-cache-folder: emsdk-cache | |
| - run: npm ci | |
| - name: Build wasm | |
| run: npm run build | |
| - name: Build JS bundles | |
| run: npm run build-es6 | |
| - name: Install Playwright browsers | |
| run: npx playwright install --with-deps chromium | |
| - name: Run Playwright e2e | |
| run: npm run test:e2e | |
| - name: Upload Playwright report on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 7 |