playwright init #95
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: Node.js CI | |
| on: | |
| push: | |
| branches: [ "main", "dev" ] | |
| pull_request: | |
| branches: [ "main", "dev" ] | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| # Required to checkout the code | |
| contents: read | |
| strategy: | |
| matrix: | |
| node-version: [24.x] | |
| os: [ubuntu-latest, windows-latest] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| cache-dependency-path: | | |
| package-lock.json | |
| packages/bootstrap/package-lock.json | |
| packages/multiplayer-template/package-lock.json | |
| - name: Build and test | |
| run: | | |
| npm ci | |
| npm run build | |
| npm run test | |
| - name: Lint | |
| run: npm run lint | |
| - name: Typecheck bootstrap | |
| run: npm run typecheck | |
| working-directory: ./packages/bootstrap | |
| - name: npm link core locally | |
| run: | | |
| npm link | |
| working-directory: ./packages/core | |
| # multiplayer-template has its own nested workspaces (client/server) that npm | |
| # workspaces does not handle recursively, so we need a separate npm ci here | |
| - name: Build multiplayer-template | |
| run: | | |
| npm link @mavonengine/core | |
| npm run typecheck | |
| npm run build | |
| npm run lint | |
| working-directory: ./packages/multiplayer-template | |
| - name: Start dev servers and verify startup | |
| timeout-minutes: 1 | |
| run: npx concurrently --kill-others --success first "npm run dev" "npx wait-on http://localhost:8050/api/game/health --timeout 20000" | |
| working-directory: ./packages/multiplayer-template | |
| e2e: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| container: mcr.microsoft.com/playwright:v1.52.0-noble | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Use Node.js 24.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24.x | |
| cache: 'npm' | |
| cache-dependency-path: | | |
| package-lock.json | |
| packages/bootstrap/package-lock.json | |
| packages/multiplayer-template/package-lock.json | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install multiplayer-template dependencies | |
| run: npm ci | |
| working-directory: ./packages/multiplayer-template | |
| - name: npm link core locally | |
| run: npm link | |
| working-directory: ./packages/core | |
| - name: Link core in editor | |
| run: npm link @mavonengine/core | |
| working-directory: ./packages/editor | |
| - name: npm link editor locally | |
| run: npm link | |
| working-directory: ./packages/editor | |
| - name: Link core and editor in multiplayer-template | |
| run: npm link @mavonengine/core @mavonengine/editor | |
| working-directory: ./packages/multiplayer-template | |
| - name: Run editor e2e tests | |
| run: npm run test:e2e | |
| working-directory: ./packages/editor |