blob: 288e97cea731f75498224b1c9e8d6ac6dd79910b [file] [edit]
name: CI - Python
on:
workflow_call:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: Build
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
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' || github.event_name == 'workflow_dispatch'
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
remote-tests:
name: Remote Tests
uses: ./.github/workflows/bazel.yml
with:
name: Integration Tests Remote
needs-display: true
rerun-with-debug: true
download-artifact-name: targets
run: >
[ -s bazel-targets-py.txt ] || echo //py/... > bazel-targets-py.txt;
{ echo "tests(//py:test-remote) intersect set("; cat bazel-targets-py.txt; echo ")"; } > query.txt;
bazel query --query_file=query.txt --output=label > remote-targets.txt;
./scripts/github-actions/bazel-test-if-targets.sh
--keep_going
--flaky_test_attempts 3
--local_test_jobs 1
--target_pattern_file=remote-targets.txt
remote-bidi-tests:
name: Remote BiDi Tests
uses: ./.github/workflows/bazel.yml
with:
name: Integration Tests Remote BiDi
needs-display: true
rerun-with-debug: true
download-artifact-name: targets
run: >
[ -s bazel-targets-py.txt ] || echo //py/... > bazel-targets-py.txt;
{ echo "tests(//py:test-remote-bidi) intersect set("; cat bazel-targets-py.txt; echo ")"; } > query.txt;
bazel query --query_file=query.txt --output=label > remote-bidi-targets.txt;
./scripts/github-actions/bazel-test-if-targets.sh
--keep_going
--flaky_test_attempts 3
--local_test_jobs 1
--target_pattern_file=remote-bidi-targets.txt
browser-tests:
name: Browser Tests
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
download-artifact-name: targets
run: >
[ -s bazel-targets-py.txt ] || echo //py/... > bazel-targets-py.txt;
{ echo "tests(//py:test-${{ matrix.browser }}) intersect set("; cat bazel-targets-py.txt; echo ")"; } > query.txt;
bazel query --query_file=query.txt --output=label > browser-targets.txt;
./scripts/github-actions/bazel-test-if-targets.sh
--keep_going
--flaky_test_attempts 3
--local_test_jobs 1
--skip_incompatible_explicit_targets
--target_pattern_file=browser-targets.txt
selenium-manager-tests:
name: Selenium Manager Tests
uses: ./.github/workflows/bazel.yml
strategy:
fail-fast: false
matrix:
os: [ubuntu, windows, macos]
with:
name: Integration Tests Selenium Manager (${{ 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
--local_test_jobs 1
--flaky_test_attempts 3
--pin_browsers=false
--build_tests_only
--skip_incompatible_explicit_targets
--test_tag_filters=se-manager
--target_pattern_file=bazel-targets-py.txt