Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

ci(e2e): add build and artifact handling for playwright tests

Steven Enamakel8acdb99b2611
diff --git a/.github/workflows/e2e-playwright.yml b/.github/workflows/e2e-playwright.yml
index 3843c4357c..580ee17e51 100644
--- a/.github/workflows/e2e-playwright.yml
+++ b/.github/workflows/e2e-playwright.yml
@@ -21,8 +21,51 @@ concurrency:
cancel-in-progress: true
jobs:
+ build-playwright:
+ name: Build Playwright E2E artifact
+ runs-on: ubuntu-22.04
+ container:
+ image: ghcr.io/tinyhumansai/openhuman_ci:latest@sha256:c3c20d625bcc9f75e50c3c2c2b75c88d3e60a3f4352b0f19f5327b490438722d
+ timeout-minutes: 60
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v7
+ with:
+ fetch-depth: 1
+ persist-credentials: false
+ submodules: recursive
+ - name: Install dependencies
+ run: bash scripts/ci-cancel-aware.sh pnpm install --frozen-lockfile
+ - name: Ensure .env exists for E2E build
+ run: |
+ touch .env
+ touch app/.env
+ - name: Build Playwright web E2E bundle and core
+ run: bash scripts/ci-cancel-aware.sh pnpm --filter openhuman-app test:e2e:web:build
+ - name: Package Playwright E2E artifact
+ run: |
+ set -euo pipefail
+ host="$(rustc -vV | awk '/^host: / { print $2 }')"
+ stage="target/playwright-artifact/repo"
+ mkdir -p "$stage/app/dist-web" "$stage/target/e2e-web-$host/debug"
+ cp -a app/dist-web/. "$stage/app/dist-web/"
+ cp -a "target/e2e-web-$host/debug/openhuman-core" "$stage/target/e2e-web-$host/debug/"
+ tar -czf e2e-playwright-linux.tar.gz -C target/playwright-artifact repo
+ - name: Upload Playwright E2E artifact
+ uses: actions/upload-artifact@v7
+ with:
+ name: e2e-playwright-linux-${{ github.run_id }}
+ path: e2e-playwright-linux.tar.gz
+ retention-days: 1
+ if-no-files-found: error
+
e2e-playwright:
- name: E2E (Playwright / web lane)
+ name: E2E (Playwright / lane ${{ matrix.lane }})
+ needs: [build-playwright]
+ strategy:
+ fail-fast: false
+ matrix:
+ lane: [1, 2, 3, 4]
runs-on: ubuntu-22.04
container:
image: ghcr.io/tinyhumansai/openhuman_ci:latest
@@ -46,22 +89,24 @@ jobs:
restore-keys: |
pnpm-store-${{ runner.os }}-
- - name: Cache Rust build artifacts
- uses: Swatinem/rust-cache@v2
- with:
- workspaces: |
- . -> target
- crates/openhuman-app -> target
- cache-on-failure: true
- key: e2e-playwright-linux
-
- name: Install JS dependencies
run: bash scripts/ci-cancel-aware.sh pnpm install --frozen-lockfile
- - name: Ensure .env exists for E2E build
+ - name: Download Playwright E2E artifact
+ uses: actions/download-artifact@v8
+ with:
+ name: e2e-playwright-linux-${{ github.run_id }}
+ path: .
+
+ - name: Restore Playwright E2E artifact
run: |
- touch .env
- touch app/.env
+ set -euo pipefail
+ tar -xzf e2e-playwright-linux.tar.gz
+ cp -a repo/app/dist-web app/
+ touch app/dist-web/openhuman-e2e-bundle.marker
+ mkdir -p target
+ cp -a repo/target/. target/
+ chmod +x target/e2e-web-*/debug/openhuman-core
- name: Install native test modules
run: |
@@ -72,9 +117,6 @@ jobs:
"$module_root" "$module_root/modules.env"
cat "$module_root/modules.env" >> "$GITHUB_ENV"
- - name: Build Playwright web E2E bundle + standalone core
- run: bash scripts/ci-cancel-aware.sh pnpm --filter openhuman-app test:e2e:web:build
-
- name: Install Playwright Chromium dependencies
run: bash scripts/ci-cancel-aware.sh pnpm --filter openhuman-app exec playwright install-deps chromium
diff --git a/package.json b/package.json
index 1e1695249e..38b98b605e 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,7 @@
"docs:check": "node scripts/generate-architecture-docs.mjs --check && node scripts/ci/check-storage-schema.mjs",
"docs:test": "node --test scripts/__tests__/generate-architecture-docs.test.mjs scripts/__tests__/generate-embed-docs.test.mjs",
"test:scripts": "node --test scripts/__tests__/*.test.mjs scripts/mock-api/*.test.mjs scripts/mock-api/routes/__tests__/*.test.mjs",
+ "e2e:ownership:check": "node scripts/ci/check-e2e-runner-ownership.mjs",
"test:inventory": "node scripts/generate-test-inventory.mjs",
"compile": "pnpm --filter openhuman-app compile",
"dev": "pnpm --filter openhuman-app dev",