Fix tests on MacOS worker (hopefully). Add worker logs to test output. #3
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: Build, Lint & Test | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| build: | |
| name: Build, Lint & Test | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 5 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| env: | |
| PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/.playwright-browsers | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| cache: 'npm' | |
| - name: Disable Windows Defender (Windows) | |
| if: runner.os == 'Windows' | |
| shell: powershell | |
| run: Set-MpPreference -DisableRealtimeMonitoring $true | |
| - name: Cache node_modules | |
| id: node-modules-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: node-modules-${{ matrix.os }}-${{ hashFiles('package-lock.json') }} | |
| - name: Install dependencies | |
| if: steps.node-modules-cache.outputs.cache-hit != 'true' | |
| run: npm ci | |
| - name: Check formatting | |
| run: npm run format:check | |
| - name: Lint code | |
| run: npm run lint | |
| - name: Run tests | |
| run: npm run test | |
| - name: Build extension | |
| run: npm run build | |
| - name: Install system dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update -qq | |
| sudo apt-get install -y --no-install-recommends xvfb | |
| - name: Cache Playwright browsers | |
| id: playwright-cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .playwright-browsers | |
| key: playwright-${{ matrix.os }}-${{ hashFiles('package-lock.json') }} | |
| - name: Install Playwright browsers | |
| if: steps.playwright-cache.outputs.cache-hit != 'true' | |
| run: npx playwright install chromium | |
| - name: Install Playwright system dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: npx playwright install-deps chromium | |
| - name: Run integration tests (Linux) | |
| id: integration-linux | |
| if: runner.os == 'Linux' | |
| run: xvfb-run --auto-servernum npm run integration:ci | |
| - name: Run integration tests (macOS/Windows) | |
| id: integration-other | |
| if: runner.os != 'Linux' | |
| run: npm run integration:ci | |
| - name: Build extension (production) | |
| run: npm run build:prod | |
| - name: Upload test videos | |
| if: always() && (steps.integration-linux.outcome == 'failure' || steps.integration-other.outcome == 'failure') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-videos | |
| path: test-videos/ | |
| if-no-files-found: ignore | |
| retention-days: 1 |