documentation + useInteraction #368
Workflow file for this run
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: Test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| unit-tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Install Playwright browsers | |
| run: bunx playwright install --with-deps chromium | |
| - name: Build packages | |
| run: bun run build | |
| - name: Run unit tests | |
| run: bun run test:ci | |
| e2e-tests: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Install Playwright browsers | |
| run: bunx playwright install --with-deps chromium | |
| - name: Build packages | |
| run: bun run build | |
| - name: Install harness dependencies | |
| run: bun install --cwd e2e/harness | |
| - name: Run E2E tests | |
| run: bun run test:e2e | |
| - name: Update screenshots and push if they changed | |
| if: failure() && github.event_name == 'pull_request' | |
| env: | |
| PR_HEAD_REF: ${{ github.head_ref }} | |
| run: | | |
| bun run test:e2e:update | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add e2e/screenshots/ | |
| if ! git diff --cached --quiet; then | |
| git commit -m "chore: regenerate e2e screenshot baselines" | |
| git push origin "HEAD:$PR_HEAD_REF" | |
| fi | |
| - name: Upload test artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: failure() | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 7 |