Add generated alias client codegen #408
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: | |
| pull_request: | |
| push: | |
| jobs: | |
| client-test: | |
| name: ${{ matrix.client }} tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| client: [js, python, go] | |
| env: | |
| CI: "true" | |
| CHROME_PATH: /usr/bin/chromium | |
| GOFLAGS: -buildvcs=false | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - uses: actions/setup-python@v5 | |
| if: matrix.client == 'python' | |
| with: | |
| python-version: "3.12" | |
| - uses: astral-sh/setup-uv@v5 | |
| if: matrix.client == 'python' | |
| - uses: actions/setup-go@v5 | |
| if: matrix.client == 'go' | |
| with: | |
| go-version-file: go/go.mod | |
| cache-dependency-path: go/go.sum | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build | |
| - name: Run ${{ matrix.client }} tests | |
| run: | | |
| case "${{ matrix.client }}" in | |
| js) | |
| pnpm exec vitest run \ | |
| $(find js/test -name 'test.*.ts' \ | |
| ! -name 'test.ModCDPClient.ts' \ | |
| ! -name 'test.NATSUpstreamTransport.ts' \ | |
| ! -name 'test.ReverseWSUpstreamTransport.ts' \ | |
| ! -name 'test.proxy.ts' | sort) \ | |
| --fileParallelism=false --maxWorkers=1 | |
| ;; | |
| python) | |
| cd python | |
| uv run python -m unittest \ | |
| $(find tests -name 'test_*.py' \ | |
| ! -name 'test_ModCDPClient.py' \ | |
| | sed 's#/#.#g; s#\.py$##' | sort) | |
| ;; | |
| go) | |
| cd go | |
| go test -count=1 -p 1 \ | |
| ./modcdp \ | |
| ./modcdp/injector \ | |
| ./modcdp/launcher \ | |
| ./modcdp/router \ | |
| ./modcdp/translate | |
| ;; | |
| *) | |
| echo "unknown client: ${{ matrix.client }}" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| client-demo: | |
| name: ${{ matrix.client }} ${{ matrix.upstream }} ${{ matrix.mode }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - client: js | |
| upstream: ws | |
| mode: direct | |
| - client: js | |
| upstream: ws | |
| mode: loopback | |
| - client: js | |
| upstream: ws | |
| mode: debugger | |
| - client: js | |
| upstream: pipe | |
| mode: direct | |
| - client: js | |
| upstream: pipe | |
| mode: loopback | |
| - client: js | |
| upstream: pipe | |
| mode: debugger | |
| - client: python | |
| upstream: ws | |
| mode: direct | |
| - client: python | |
| upstream: ws | |
| mode: loopback | |
| - client: python | |
| upstream: ws | |
| mode: debugger | |
| - client: go | |
| upstream: ws | |
| mode: direct | |
| - client: go | |
| upstream: ws | |
| mode: loopback | |
| - client: go | |
| upstream: ws | |
| mode: debugger | |
| env: | |
| CI: "true" | |
| CHROME_PATH: /usr/bin/chromium | |
| GOFLAGS: -buildvcs=false | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - uses: actions/setup-python@v5 | |
| if: matrix.client == 'python' | |
| with: | |
| python-version: "3.12" | |
| - uses: astral-sh/setup-uv@v5 | |
| if: matrix.client == 'python' | |
| - uses: actions/setup-go@v5 | |
| if: matrix.client == 'go' | |
| with: | |
| go-version-file: go/go.mod | |
| cache-dependency-path: go/go.sum | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build | |
| - name: Run ${{ matrix.client }} demo (${{ matrix.mode }}) | |
| run: | | |
| case "${{ matrix.client }}" in | |
| js) | |
| node dist/js/examples/demo.js --${{ matrix.mode }} --upstream=${{ matrix.upstream }} | |
| ;; | |
| python) | |
| cd python | |
| uv run python examples/demo.py --${{ matrix.mode }} --upstream=${{ matrix.upstream }} | |
| ;; | |
| go) | |
| cd go | |
| go run ./examples/demo --${{ matrix.mode }} --upstream=${{ matrix.upstream }} | |
| ;; | |
| *) | |
| echo "unknown client: ${{ matrix.client }}" >&2 | |
| exit 1 | |
| ;; | |
| esac | |
| serialized-connector-test: | |
| name: serialized reversews/nats tests | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| env: | |
| CI: "true" | |
| CHROME_PATH: /usr/bin/chromium | |
| GOFLAGS: -buildvcs=false | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - uses: astral-sh/setup-uv@v5 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go/go.mod | |
| cache-dependency-path: go/go.sum | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build | |
| - name: Run JS serialized non-reverse connector tests | |
| run: | | |
| pnpm exec vitest run \ | |
| js/test/test.ModCDPClient.ts \ | |
| js/test/test.NATSUpstreamTransport.ts \ | |
| js/test/test.proxy.ts \ | |
| --testNamePattern "^(?!.*reversews).*" \ | |
| --fileParallelism=false --maxWorkers=1 | |
| - name: Run JS serialized reversews tests | |
| run: | | |
| pnpm exec vitest run \ | |
| js/test/test.ReverseWSUpstreamTransport.ts \ | |
| js/test/test.proxy.ts \ | |
| --testNamePattern "reversews" \ | |
| --fileParallelism=false --maxWorkers=1 | |
| - name: Run Python serialized non-reverse connector tests | |
| run: | | |
| cd python | |
| uv run python -m unittest tests.test_ModCDPClient | |
| - name: Run Go serialized non-reverse connector tests | |
| run: | | |
| cd go | |
| go test -count=1 -p 1 ./modcdp/client | |
| go test -count=1 -p 1 ./modcdp/transport -run 'Test(UpstreamTransport|WebSocketUpstreamTransport)' | |
| serialized-reversews-demo: | |
| name: serialized reversews demos | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| env: | |
| CI: "true" | |
| CHROME_PATH: /usr/bin/chromium | |
| GOFLAGS: -buildvcs=false | |
| BROWSERBASE_API_KEY: ${{ secrets.BROWSERBASE_API_KEY }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build | |
| - name: Run reversews demos serially | |
| run: | | |
| for mode in loopback debugger; do | |
| node dist/js/examples/demo.js --"$mode" --upstream=reversews | |
| done | |
| proxy-example: | |
| name: ${{ matrix.name }} | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: playwright proxy | |
| command: node dist/js/examples/playwright.js | |
| - name: puppeteer proxy | |
| command: node dist/js/examples/puppeteer.js | |
| env: | |
| CI: "true" | |
| CHROME_PATH: /usr/bin/chromium | |
| GOFLAGS: -buildvcs=false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm run build | |
| - run: ${{ matrix.command }} |