Repository navigation
Remove duplicated code from shared, core, backend and conformance #1323
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: 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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | |
| with: | |
| version: 10.26.1 | |
| 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@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | |
| with: | |
| version: 10.26.1 | |
| 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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | |
| with: | |
| version: 10.26.1 | |
| 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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | |
| with: | |
| version: 10.26.1 | |
| run_install: false | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: 📦 Bundle | |
| run: pnpm -r --workspace-concurrency=1 build | |
| - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.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 | |
| - 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 | |
| - name: Upload traces and run logs | |
| if: failure() | |
| 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 | |
| # 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@820762786026740c76f36085b0efc47a31fe5020 # v7.0.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@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10 | |
| with: | |
| version: 10.26.1 | |
| 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" |