name: Browser tests on: push: branches: [main] pull_request: branches: [main] schedule: - cron: "17 3 * * 1" workflow_dispatch: permissions: contents: read concurrency: group: browser-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: build-demo: name: Build shared browser fixture runs-on: ubuntu-24.04 timeout-minutes: 15 steps: - uses: actions/checkout@v5 - uses: pnpm/action-setup@v4 with: version: 10.6.5 - uses: actions/setup-node@v6 with: node-version: 24.x cache: pnpm - run: pnpm install --frozen-lockfile - run: pnpm build:packages && pnpm --filter demo build - uses: actions/upload-artifact@v5 with: name: browser-demo-build path: packages/demo/dist if-no-files-found: error retention-days: 1 desktop-and-unit: name: Unit checks and desktop browser behavior runs-on: ubuntu-24.04 timeout-minutes: 20 steps: - uses: actions/checkout@v5 - name: Prepare browser disk space run: bash scripts/ci/browser-disk.sh prepare - uses: pnpm/action-setup@v4 with: version: 10.6.5 - uses: actions/setup-node@v6 with: node-version: 24.x cache: pnpm - run: pnpm install --frozen-lockfile - run: pnpm check - run: pnpm exec playwright install --with-deps chromium - name: Report disk space before browser tests run: bash scripts/ci/browser-disk.sh report - run: pnpm test:app:browser env: MARKORA_BROWSER_BUILD: reuse - name: Report final disk usage if: ${{ !cancelled() }} run: bash scripts/ci/browser-disk.sh report - uses: actions/upload-artifact@v5 if: failure() with: name: desktop-browser-failures path: test-results/app required: needs: build-demo if: github.event_name == 'push' || github.event_name == 'pull_request' name: Required / ${{ matrix.browser }} runs-on: ubuntu-24.04 timeout-minutes: 30 strategy: fail-fast: false matrix: browser: [chromium, firefox, webkit] steps: - name: Check out repository uses: actions/checkout@v5 - name: Prepare browser disk space run: bash scripts/ci/browser-disk.sh prepare - name: Install pnpm uses: pnpm/action-setup@v4 with: version: 10.6.5 run_install: false - name: Set up Node.js uses: actions/setup-node@v6 with: node-version: 24.x cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile - name: Install browser run: pnpm exec playwright install --with-deps ${{ matrix.browser }} - name: Typecheck browser tests run: pnpm typecheck:browser - uses: actions/download-artifact@v5 with: name: browser-demo-build path: packages/demo/dist - name: Report disk space before browser tests run: bash scripts/ci/browser-disk.sh report - name: Run required browser tests run: pnpm exec playwright test --project=${{ matrix.browser }} --grep @required env: MARKORA_BROWSER_BUILD: reuse DEBUG: ${{ matrix.browser == 'webkit' && 'pw:browser' || '' }} - name: Report final disk usage if: ${{ !cancelled() }} run: bash scripts/ci/browser-disk.sh report - name: Upload browser artifacts if: ${{ !cancelled() }} uses: actions/upload-artifact@v5 with: name: browser-required-${{ matrix.browser }}-${{ github.run_attempt }} path: | playwright-report test-results ci-results if-no-files-found: ignore retention-days: 14 full-matrix: needs: build-demo if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' name: Full / ${{ matrix.browser }} runs-on: ubuntu-24.04 timeout-minutes: 45 strategy: fail-fast: false matrix: browser: [chromium, firefox, webkit] steps: - name: Check out repository uses: actions/checkout@v5 - name: Prepare browser disk space run: bash scripts/ci/browser-disk.sh prepare - name: Install pnpm uses: pnpm/action-setup@v4 with: version: 10.6.5 run_install: false - name: Set up Node.js uses: actions/setup-node@v6 with: node-version: 24.x cache: pnpm - name: Install dependencies run: pnpm install --frozen-lockfile - name: Install browser run: pnpm exec playwright install --with-deps ${{ matrix.browser }} - name: Typecheck browser tests run: pnpm typecheck:browser - uses: actions/download-artifact@v5 with: name: browser-demo-build path: packages/demo/dist - name: Report disk space before browser tests run: bash scripts/ci/browser-disk.sh report - name: Run full browser suite run: pnpm exec playwright test --project=${{ matrix.browser }} env: MARKORA_BROWSER_BUILD: reuse DEBUG: ${{ matrix.browser == 'webkit' && 'pw:browser' || '' }} - name: Report final disk usage if: ${{ !cancelled() }} run: bash scripts/ci/browser-disk.sh report - name: Upload browser artifacts if: ${{ !cancelled() }} uses: actions/upload-artifact@v5 with: name: browser-full-${{ matrix.browser }}-${{ github.run_attempt }} path: | playwright-report test-results ci-results if-no-files-found: ignore retention-days: 14