-
Notifications
You must be signed in to change notification settings - Fork 899
51 lines (51 loc) · 1.67 KB
/
test_docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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: ubuntu-22.04
strategy:
fail-fast: false
matrix:
docker-image-variant:
- focal
- jammy
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -e .
- name: Build Docker image
run: bash utils/docker/build.sh --amd64 ${{ matrix.docker-image-variant }} playwright-python:localbuild-${{ matrix.docker-image-variant }}
- name: Test
run: |
CONTAINER_ID="$(docker run --rm -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 "${CONTAINER_ID}" chown -R root:root /root/playwright
docker exec "${CONTAINER_ID}" pip install -r local-requirements.txt
docker exec "${CONTAINER_ID}" pip install -e .
docker exec "${CONTAINER_ID}" python setup.py bdist_wheel
docker exec "${CONTAINER_ID}" xvfb-run pytest -vv tests/sync/
docker exec "${CONTAINER_ID}" xvfb-run pytest -vv tests/async/