| name: CI - Python |
| |
| on: |
| workflow_call: |
| inputs: |
| smoke: |
| description: Smoke tests always run; callers pass false to add the full matrix |
| required: false |
| type: boolean |
| default: true |
| compile-manager: |
| description: Build Selenium Manager from source instead of downloading the pinned binary |
| required: false |
| type: boolean |
| default: false |
| workflow_dispatch: |
| inputs: |
| smoke: |
| description: Smoke tests only (default also runs the full matrix) |
| required: false |
| type: boolean |
| default: false |
| compile-manager: |
| description: Build Selenium Manager from source instead of downloading the pinned binary |
| required: false |
| type: boolean |
| default: false |
| |
| permissions: |
| contents: read |
| |
| # Two tiers, mutually exclusive by content. `smoke` runs on every event, including |
| # schedule, so the schedule-only flaky parser sees it. The full jobs run on schedule |
| # or dispatch and exclude the smoke tags, so they are the nightly complement of |
| # smoke rather than the whole tree. |
| jobs: |
| build: |
| name: Build |
| if: github.event_name == 'schedule' || !inputs.smoke |
| uses: ./.github/workflows/bazel.yml |
| with: |
| name: Build |
| run: | |
| bazel build //py:selenium-wheel //py:selenium-sdist |
| |
| lint-ruff: |
| name: Lint (ruff) |
| uses: ./.github/workflows/bazel.yml |
| with: |
| name: Lint (ruff) |
| run: bazel run //py:ruff-check -- --no-fix |
| |
| lint-mypy: |
| name: Lint (mypy) |
| uses: ./.github/workflows/bazel.yml |
| with: |
| name: Lint (mypy) |
| run: bazel run //py:mypy |
| |
| lint-docs: |
| name: Lint (docs) |
| uses: ./.github/workflows/bazel.yml |
| with: |
| name: Lint (docs) |
| run: | |
| bazel run //py:generate-api-listing |
| bazel run //py:sphinx-autogen |
| bazel build //py:docs |
| |
| unit-tests: |
| name: Unit Tests |
| if: github.event_name == 'schedule' || !inputs.smoke |
| uses: ./.github/workflows/bazel.yml |
| strategy: |
| fail-fast: false |
| matrix: |
| python-version: ['3.10', '3.14'] |
| os: [ubuntu, macos, windows] |
| with: |
| name: Unit Tests (${{ matrix.python-version }}, ${{ matrix.os }}) |
| os: ${{ matrix.os }} |
| python-version: ${{ matrix.python-version }} |
| run: bazel test --local_test_jobs 1 //py:unit |
| |
| smoke: |
| name: ${{ matrix.os }}-smoke |
| uses: ./.github/workflows/bazel.yml |
| strategy: |
| fail-fast: false |
| matrix: |
| os: [windows, macos] |
| tag_filters: ["os-sensitive,se-manager,skip-rbe"] |
| include: |
| # RBE already runs the os-sensitive targets on Linux; ubuntu is here for what needs network. |
| - os: ubuntu |
| tag_filters: se-manager,skip-rbe |
| with: |
| name: ${{ matrix.os }} |
| needs-display: true |
| os: ${{ matrix.os }} |
| rerun-with-debug: true |
| download-artifact-name: targets |
| run: > |
| [ -s bazel-targets-py.txt ] || echo //py/... > bazel-targets-py.txt; |
| ./scripts/github-actions/bazel-test-if-targets.sh |
| --keep_going |
| --flaky_test_attempts 3 |
| --local_test_jobs 1 |
| --build_tests_only |
| --skip_incompatible_explicit_targets |
| --pin_browsers=false |
| ${{ inputs.compile-manager && '--manager=host' || '' }} |
| --test_tag_filters=${{ matrix.tag_filters }} |
| --target_pattern_file=bazel-targets-py.txt |
| |
| browser-tests: |
| name: Browser Tests |
| if: github.event_name == 'schedule' || !inputs.smoke |
| uses: ./.github/workflows/bazel.yml |
| strategy: |
| fail-fast: false |
| matrix: |
| browser: [chrome, firefox, chrome-bidi, edge] |
| os: [windows] |
| include: |
| - browser: safari |
| os: macos |
| with: |
| name: Integration Tests (${{ matrix.browser }}) |
| needs-display: true |
| os: ${{ matrix.os }} |
| rerun-with-debug: true |
| run: > |
| bazel test |
| --keep_going |
| --flaky_test_attempts 3 |
| --local_test_jobs 1 |
| --pin_browsers=false |
| ${{ inputs.compile-manager && '--manager=host' || '' }} |
| --test_tag_filters=-os-sensitive,-se-manager,-skip-rbe |
| //py:test-${{ matrix.browser }} |