Keep Mac awake while agents run #1
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: Awake E2E | |
| on: | |
| push: | |
| branches: | |
| - keep-awake-while-lid-closed | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| workflow_dispatch: | |
| inputs: | |
| ref: | |
| description: Ref to check out (defaults to the workflow ref) | |
| required: false | |
| type: string | |
| jobs: | |
| awake: | |
| # Why: temporary PR validation for the keep-awake branch. Keep it out of | |
| # unrelated PRs until the cross-platform coverage graduates into normal CI. | |
| if: github.event_name != 'pull_request' || github.head_ref == 'keep-awake-while-lid-closed' | |
| name: awake e2e ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 20 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-22.04, windows-latest] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.ref || github.ref }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: package.json | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: false | |
| - name: Install Linux runtime and build tools | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y build-essential python3 xvfb | |
| # Why: pnpm's bundled node-gyp can ship gyp_main.py without execute | |
| # permission on Linux runners; keep this aligned with the main E2E job. | |
| - name: Use external node-gyp to avoid pnpm's bundled copy (Linux only) | |
| if: runner.os == 'Linux' | |
| run: | | |
| npm install -g node-gyp@11.5.0 | |
| echo "npm_config_node_gyp=$(npm root -g)/node-gyp/bin/node-gyp.js" >> "$GITHUB_ENV" | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build Electron app for E2E | |
| run: pnpm exec electron-vite build --mode e2e | |
| - name: Run awake Playwright spec on Linux | |
| if: runner.os == 'Linux' | |
| env: | |
| SKIP_BUILD: '1' | |
| ORCA_E2E_FORWARD_APP_LOGS: '1' | |
| run: xvfb-run --auto-servernum pnpm exec playwright test tests/e2e/settings-agent-awake.spec.ts --config tests/playwright.config.ts --project=electron-headless | |
| - name: Run awake Playwright spec on Windows | |
| if: runner.os == 'Windows' | |
| env: | |
| SKIP_BUILD: '1' | |
| ORCA_E2E_FORWARD_APP_LOGS: '1' | |
| run: pnpm exec playwright test tests/e2e/settings-agent-awake.spec.ts --config tests/playwright.config.ts --project=electron-headless | |
| - name: Upload Playwright traces | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: awake-playwright-traces-${{ matrix.os }} | |
| path: test-results/ | |
| retention-days: 7 | |
| if-no-files-found: ignore |