name: CI on: push: branches: - main tags: - v[0-9]+.[0-9]+.[0-9]+* pull_request: permissions: contents: read jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Use Node.js uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version-file: .nvmrc # the runner cache can hold a 24.x below the engines floor check-latest: true - name: Cache pnpm modules uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 env: cache-name: cache-pnpm-modules with: path: ~/.pnpm-store key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: run_install: false - name: Install dependencies run: pnpm install --frozen-lockfile - name: Lint run: pnpm lint - name: ๐Ÿ“ฆ Bundle run: pnpm -r --workspace-concurrency=1 build # Four tsc programs โ€” see the `typecheck` script. Runs before the tests # because it is fast and its failures are cheaper to read. - name: ๐Ÿ”Ž Typecheck run: pnpm typecheck # The conformance suite runs the Python adapter beside the JS ones; the `test` extra brings pytest, its runner. - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: '3.13' - name: Install the Python adapter run: pip install -e 'packages/selenium-devtools-py[test]' - name: ๐Ÿงช Run Tests run: pnpm test - name: Upload conformance report if: failure() uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: conformance-report path: packages/conformance/out/ if-no-files-found: ignore # Separate job because these are the only tests that need a real browser, and # they parallelise with `build` instead of extending it. No bundle step: the # specs and packages/app/src reach @wdio/devtools-shared through its source # exports, so Vite compiles everything from source. Chrome comes preinstalled # on the runner image; wdio fetches the matching driver itself. component-tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Use Node.js uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version-file: .nvmrc # the runner cache can hold a 24.x below the engines floor check-latest: true - name: Cache pnpm modules uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 env: cache-name: cache-pnpm-modules with: path: ~/.pnpm-store key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: run_install: false - name: Install dependencies run: pnpm install --frozen-lockfile # Two workers, not the runner default: each carries a Vite server plus a # Chrome, and past 2 the heaviest specs time out under that contention. - name: ๐Ÿงฉ Component Tests run: pnpm test:ui --maxInstances 2 # Builds the hosted trace player, serves it under the headers vercel.json # sends, and opens the committed older-format zips, a zip from this # checkout's writer and a non-zip through it in headless Chrome, failing on # any console error or CSP violation. Its own job: it needs only the app's # hosted build, not the bundle the other jobs build, so it runs beside # them. Chrome comes preinstalled on the runner image; WebdriverIO fetches # the matching driver itself. scheduled-hosted-player.yml runs the same # check against the deployed page. hosted-player: runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Use Node.js uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version-file: .nvmrc # the runner cache can hold a 24.x below the engines floor check-latest: true - name: Cache pnpm modules uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 env: cache-name: cache-pnpm-modules with: path: ~/.pnpm-store key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: run_install: false - name: Install dependencies run: pnpm install --frozen-lockfile - name: Chrome version run: google-chrome --version - name: ๐ŸŽž๏ธ Hosted trace player end-to-end run: pnpm player:e2e # Runs one desktop example per adapter in trace mode against a local fixture # site and checks each trace zip against # packages/conformance/smoke/expectations/. The conformance suite covers the # adapters against a fake browser; this covers the examples users copy, in a # real headless Chrome (preinstalled on the runner image; each framework # resolves its own driver). Mobile and Safari stay manual. examples-smoke: runs-on: ubuntu-latest timeout-minutes: 30 env: # FIXTURE_DEFAULT_HOST/PORT in packages/conformance/smoke/constants.ts. DEVTOOLS_EXAMPLE_BASE_URL: http://127.0.0.1:4567 DEVTOOLS_MODE: trace DEVTOOLS_OPEN: '0' steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Use Node.js uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version-file: .nvmrc # the runner cache can hold a 24.x below the engines floor check-latest: true - name: Cache pnpm modules uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 env: cache-name: cache-pnpm-modules with: path: ~/.pnpm-store key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: run_install: false - name: Install dependencies run: pnpm install --frozen-lockfile - name: ๐Ÿ“ฆ Bundle run: pnpm -r --workspace-concurrency=1 build - uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 with: python-version: '3.13' - name: Install the Python adapter run: pip install -e 'packages/selenium-devtools-py[test]' - name: Chrome version run: google-chrome --version - name: Start the fixture site id: fixture run: | nohup pnpm -s smoke:fixtures > "$RUNNER_TEMP/fixture-site.log" 2>&1 & for _ in $(seq 1 30); do curl -sf "$DEVTOOLS_EXAMPLE_BASE_URL/login" > /dev/null && exit 0 sleep 1 done cat "$RUNNER_TEMP/fixture-site.log" exit 1 # One step per example so a red step names it; each runs even when an # earlier one failed. - name: ๐Ÿงช WebdriverIO + Mocha (examples/wdio/mocha) if: ${{ !cancelled() && steps.fixture.outcome == 'success' }} run: bash .github/scripts/examples-smoke/run-example.sh wdio-mocha pnpm demo:wdio:mocha # Both features, so the deliberately failing one is in the run. - name: ๐Ÿงช WebdriverIO + Cucumber (examples/wdio/cucumber) if: ${{ !cancelled() && steps.fixture.outcome == 'success' }} run: bash .github/scripts/examples-smoke/run-example.sh wdio-cucumber env DEVTOOLS_SPECS=all pnpm demo:wdio - name: ๐Ÿงช Selenium + Mocha (examples/selenium-js/mocha) if: ${{ !cancelled() && steps.fixture.outcome == 'success' }} run: bash .github/scripts/examples-smoke/run-example.sh selenium-mocha pnpm --filter @wdio/selenium-devtools example:mocha - name: ๐Ÿงช Nightwatch BDD (examples/nightwatch/bdd) if: ${{ !cancelled() && steps.fixture.outcome == 'success' }} run: bash .github/scripts/examples-smoke/run-example.sh nightwatch-bdd pnpm demo:nightwatch # This job's DEVTOOLS_MODE=trace reaches the example through its conftest.py, # whose defaults keep only failing tests' archives; one archive for the whole # run is what the expectations describe, and `-o` outranks those defaults. - name: ๐Ÿงช Python + pytest (examples/selenium-py/pytest) if: ${{ !cancelled() && steps.fixture.outcome == 'success' }} run: >- bash .github/scripts/examples-smoke/run-example.sh python-pytest python -m pytest examples/selenium-py/pytest -o devtools_trace_policy=on -o devtools_trace_granularity=session # Kept on success too: a green run's zips are where new trace-format reader fixtures come from. - name: Upload traces and run logs if: ${{ !cancelled() }} uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 with: name: examples-smoke path: | ${{ runner.temp }}/examples-smoke/ ${{ runner.temp }}/fixture-site.log if-no-files-found: ignore retention-days: 7 # The workspace develops against one WebdriverIO major, but the service and # @wdio/elements declare peers on two. Each published major is installed from # npm into a scratch project beside the packed tarballs, so a peer conflict, a # broken entry point or a type mismatch with that major fails here first. 9 # runs too so a red 10 can be told apart from a broken harness. wdio-peer: name: wdio-peer (webdriverio ${{ matrix.wdio }}) runs-on: ubuntu-latest strategy: fail-fast: false matrix: wdio: [9, 10] steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - name: Use Node.js uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 with: node-version-file: .nvmrc # the runner cache can hold a 24.x below the engines floor check-latest: true - name: Cache pnpm modules uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 env: cache-name: cache-pnpm-modules with: path: ~/.pnpm-store key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- - uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1 with: run_install: false - name: Install dependencies run: pnpm install --frozen-lockfile # The trailing `...` also builds what the two packages depend on, which # includes the app the backend tarball serves. - name: ๐Ÿ“ฆ Bundle run: pnpm --workspace-concurrency=1 --filter "@wdio/devtools-service..." --filter "@wdio/elements..." build - name: ๐Ÿ”Œ Install, import and type-check against WebdriverIO ${{ matrix.wdio }} run: bash .github/scripts/wdio-peer-smoke/run.sh ${{ matrix.wdio }} "$RUNNER_TEMP/wdio-peer"