Skip to content

[codex] Add Browser Use cloud integration #1366

[codex] Add Browser Use cloud integration

[codex] Add Browser Use cloud integration #1366

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: write
jobs:
# Build Docker images (no push) to catch Dockerfile regressions before merge.
docker-preflight:
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
env:
HAS_HYBRIDAI_API_KEY: ${{ secrets.HYBRIDAI_API_KEY != '' }}
strategy:
fail-fast: false
matrix:
include:
- name: agent
context: ./container
file: ./container/Dockerfile
target: runtime
- name: gateway
context: .
file: ./Dockerfile
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Buildx
uses: docker/setup-buildx-action@v3
- name: Build ${{ matrix.name }} image
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
file: ${{ matrix.file }}
target: ${{ matrix.target }}
push: false
load: true
tags: hybridclaw-${{ matrix.name }}:preflight
cache-from: type=gha,scope=${{ matrix.name }}-preflight
cache-to: type=gha,mode=max,scope=${{ matrix.name }}-preflight
- name: Setup Node.js (e2e)
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install test dependencies (e2e)
run: npm install
- name: Gateway e2e tests (local, no API key)
if: matrix.name == 'gateway'
env:
HYBRIDCLAW_RUN_DOCKER_E2E: '1'
HYBRIDCLAW_E2E_IMAGE: hybridclaw-gateway:preflight
run: npx vitest run --config vitest.e2e.config.ts tests/gateway-docker.e2e.test.ts
- name: Gateway e2e tests (external services)
if: matrix.name == 'gateway' && env.HAS_HYBRIDAI_API_KEY == 'true'
env:
HYBRIDCLAW_RUN_DOCKER_E2E: '1'
HYBRIDCLAW_E2E_IMAGE: hybridclaw-gateway:preflight
HYBRIDAI_API_KEY: ${{ secrets.HYBRIDAI_API_KEY }}
run: npx vitest run --config vitest.e2e.config.ts tests/gateway-docker.e2e.test.ts -t "provider|chat API"
- name: Agent container e2e tests
if: matrix.name == 'agent'
env:
HYBRIDCLAW_RUN_DOCKER_E2E: '1'
HYBRIDCLAW_E2E_AGENT_IMAGE: hybridclaw-agent:preflight
run: npx vitest run --config vitest.e2e.config.ts tests/agent-container.e2e.test.ts
unit-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm install
- name: Install container dependencies
run: npm run setup
- name: Biome check (changed files)
shell: bash
run: |
set -euo pipefail
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
BASE_SHA="${{ github.event.pull_request.base.sha }}"
else
BASE_SHA="${{ github.event.before }}"
fi
HEAD_SHA="${{ github.sha }}"
FILES=()
if [[ -z "${BASE_SHA}" || "${BASE_SHA}" == "0000000000000000000000000000000000000000" ]]; then
while IFS= read -r file; do
[[ -n "${file}" ]] && FILES+=("${file}")
done < <(git ls-files src | grep -E '^src/.*\.(ts|tsx|js|jsx)$' || true)
else
while IFS= read -r file; do
[[ -n "${file}" ]] && FILES+=("${file}")
done < <(
git diff --name-only --diff-filter=ACMRT "${BASE_SHA}" "${HEAD_SHA}" \
| grep -E '^src/.*\.(ts|tsx|js|jsx)$' || true
)
fi
if [[ "${#FILES[@]}" -eq 0 ]]; then
echo "No changed source files for Biome check."
exit 0
fi
echo "Running Biome on changed files:"
printf ' - %s\n' "${FILES[@]}"
npx biome check "${FILES[@]}"
- name: TypeScript lint (root)
run: npm run lint
- name: TypeScript lint (container)
run: npm --prefix container run lint
- name: Build release artifacts
run: npm run build
- name: Release bundle check (root)
run: npm run release:check
- name: Release bundle check (container)
run: npm --prefix container run release:check
- name: Integration tests
run: npx vitest run --config vitest.integration.config.ts
- name: Unit tests with coverage
run: npx vitest run --coverage --config vitest.unit.config.ts
- name: Generate coverage badge
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
PCT=$(node -e "
const s = require('./coverage/coverage-summary.json').total.lines;
console.log(Math.round(s.pct));
")
COLOR="red"
if [ "$PCT" -ge 80 ]; then COLOR="brightgreen"
elif [ "$PCT" -ge 60 ]; then COLOR="green"
elif [ "$PCT" -ge 40 ]; then COLOR="yellowgreen"
elif [ "$PCT" -ge 20 ]; then COLOR="yellow"
fi
mkdir -p badge
echo "{\"schemaVersion\":1,\"label\":\"coverage\",\"message\":\"${PCT}%\",\"color\":\"${COLOR}\"}" > badge/coverage.json
- name: Publish coverage badge to gh-pages
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./badge
destination_dir: badge
keep_files: true
npm-e2e:
needs: unit-tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm install
- name: Build release artifacts
run: npm run build
- name: npm install journey e2e
env:
HYBRIDCLAW_RUN_NPM_E2E: '1'
run: npx vitest run --config vitest.e2e.config.ts tests/npm-install.e2e.test.ts