Update hub-client changelog for adc5d92c #4
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: Hub-Client E2E Tests | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'hub-client/**' | |
| - '.github/workflows/hub-client-e2e.yml' | |
| workflow_dispatch: | |
| inputs: | |
| recreate-all-snapshots: | |
| description: 'Delete and recreate ALL visual regression baselines' | |
| type: boolean | |
| default: false | |
| jobs: | |
| e2e-tests: | |
| runs-on: ubuntu-latest-8x | |
| name: Hub-Client E2E Tests | |
| if: github.repository == 'quarto-dev/q2' | |
| steps: | |
| - name: Checkout Repo | |
| uses: actions/checkout@v4 | |
| # Fix mtimes for build caching | |
| - name: Restore file modification times | |
| shell: bash | |
| run: | | |
| git ls-files | while read file; do | |
| time=$(git log -1 --format='@%ct' -- "$file" 2>/dev/null || echo '@0') | |
| [ "$time" != "@0" ] && touch -d "$time" "$file" 2>/dev/null || true | |
| done | |
| # Rust toolchain for WASM build | |
| - name: Set up Rust nightly | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Set up Clang | |
| uses: egor-tensin/setup-clang@v1 | |
| with: | |
| version: latest | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| - name: Install wasm-pack | |
| run: cargo install wasm-pack | |
| # tree-sitter for grammar builds | |
| - name: Set up tree-sitter CLI | |
| run: | | |
| curl -LO https://github.com/tree-sitter/tree-sitter/releases/download/v0.25.8/tree-sitter-linux-x86.gz | |
| gunzip tree-sitter-linux-x86.gz | |
| chmod +x tree-sitter-linux-x86 | |
| sudo mv tree-sitter-linux-x86 /usr/local/bin/tree-sitter | |
| # Node.js and dependencies | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - name: Install npm dependencies | |
| run: npm ci | |
| - name: Build TypeScript packages | |
| run: npm run build | |
| # Build WASM module | |
| - name: Build WASM | |
| run: | | |
| cd hub-client | |
| npm run build:wasm | |
| # Install Playwright browsers | |
| - name: Install Playwright | |
| run: | | |
| cd hub-client | |
| npx playwright install --with-deps chromium | |
| # Delete all snapshots if recreating from scratch | |
| - name: Delete all snapshots (recreate mode) | |
| if: inputs.recreate-all-snapshots == true | |
| run: find hub-client/e2e -type d -name '*-snapshots' -exec rm -rf {} + || true | |
| # Run E2E tests (functional) | |
| - name: Run E2E tests | |
| run: | | |
| cd hub-client | |
| npx playwright test | |
| # Run visual regression tests | |
| - name: Run visual tests | |
| id: visual | |
| continue-on-error: true | |
| run: | | |
| cd hub-client | |
| npx playwright test --config playwright.visual.config.ts | |
| # If visual tests failed, retry with --update-snapshots=missing | |
| # This only creates baselines for NEW tests; existing mismatches still fail | |
| - name: Retry visual tests (add missing baselines) | |
| id: visual-retry | |
| if: steps.visual.outcome == 'failure' | |
| run: | | |
| cd hub-client | |
| npx playwright test --config playwright.visual.config.ts --update-snapshots=missing | |
| # If retry passed (only missing baselines), commit them back | |
| - name: Commit new baselines | |
| if: steps.visual.outcome == 'failure' && steps.visual-retry.outcome == 'success' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add -f hub-client/e2e/**/*-snapshots/ | |
| git diff --cached --quiet || git commit -m "Add missing Playwright visual regression baselines" | |
| git push | |
| # Fail the workflow if visual retry also failed (real regression) | |
| - name: Fail on visual regression | |
| if: steps.visual-retry.outcome == 'failure' | |
| run: exit 1 | |
| # Upload test artifacts on failure | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: playwright-report | |
| path: hub-client/playwright-report/ | |
| retention-days: 7 |