Repository navigation
devops(ci): run the Docker tests on the 64-core runners #853
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: Test Docker | |
| on: | |
| push: | |
| paths: | |
| - '.github/workflows/test_docker.yml' | |
| - 'setup.py' | |
| - '**/Dockerfile.*' | |
| branches: | |
| - main | |
| - release-* | |
| pull_request: | |
| paths: | |
| - '.github/workflows/test_docker.yml' | |
| - 'setup.py' | |
| - '**/Dockerfile.*' | |
| branches: | |
| - main | |
| - release-* | |
| jobs: | |
| build: | |
| timeout-minutes: 120 | |
| runs-on: ${{ matrix.runs-on }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| docker-image-variant: | |
| - jammy | |
| - noble | |
| - resolute | |
| arch: | |
| - amd64 | |
| - arm64 | |
| include: | |
| - arch: amd64 | |
| runs-on: playwright-x64-ubuntu24-64-core | |
| - arch: arm64 | |
| runs-on: playwright-arm64-ubuntu24-64-core | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| - name: Set up Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: "3.10" | |
| - name: Set up Node.js | |
| uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 | |
| with: | |
| node-version: '24' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r local-requirements.txt | |
| pip install -r requirements.txt | |
| pip install -e . | |
| - name: Get Playwright | |
| run: python scripts/upstream.py checkout | |
| - name: Set up Docker | |
| run: | | |
| if ! command -v docker >/dev/null 2>&1; then | |
| curl -fsSL https://get.docker.com | sh | |
| fi | |
| sudo service docker stop | |
| sudo mkdir -p /etc/docker /mnt/docker | |
| echo '{ "data-root": "/mnt/docker" }' | sudo tee /etc/docker/daemon.json | |
| sudo service docker start | |
| # The docker group of a fresh install applies at the next login only. | |
| sudo chmod 666 /var/run/docker.sock | |
| # build.sh builds the wheels, and with them the driver. | |
| - name: Build Docker image | |
| run: bash utils/docker/build.sh --${{ matrix.arch }} ${{ matrix.docker-image-variant }} playwright-python:localbuild-${{ matrix.docker-image-variant }} | |
| - name: Start the container | |
| id: container | |
| run: | | |
| docker run --rm -e CI -e PYTHONPATH=scripts -v $(pwd):/root/playwright --name playwright-docker-test --workdir /root/playwright/ -d -t playwright-python:localbuild-${{ matrix.docker-image-variant }} /bin/bash | |
| # Fix permissions for Git inside the container | |
| docker exec playwright-docker-test chown -R root:root /root/playwright | |
| docker exec playwright-docker-test pip install -r local-requirements.txt | |
| docker exec playwright-docker-test pip install -r requirements.txt | |
| docker exec playwright-docker-test pip install -e . | |
| # The repo, with the driver that build.sh built into driver/, is bind-mounted | |
| # into the container: this wheel build reuses that driver, and needs no | |
| # Node.js in the image. | |
| docker exec playwright-docker-test python -m build --wheel | |
| # As in ci.yml: the dot reporter (scripts/pytest_dot_reporter.py, found through | |
| # PYTHONPATH), and 16 workers. | |
| - name: Test Sync API | |
| run: docker exec playwright-docker-test xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" pytest tests/sync -n 16 -p pytest_dot_reporter -rfE --color=yes | |
| - name: Test Async API | |
| # Also after a failed sync step: the two suites report on their own. | |
| if: ${{ !cancelled() && steps.container.outcome == 'success' }} | |
| run: docker exec playwright-docker-test xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" pytest tests/async -n 16 -p pytest_dot_reporter -rfE --color=yes |