forked from microsoft/playwright-python
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (125 loc) · 4.15 KB
/
ci.yml
File metadata and controls
125 lines (125 loc) · 4.15 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
infra:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: microsoft/playwright-github-action@v1
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -e .
- name: Lint
run: pre-commit run --all-files
- name: Build driver
run: python build_driver.py
- name: Test Sync generation script
run: bash buildbots/test-sync-generation.sh
build:
name: Build
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.7, 3.8]
browser: [chromium, firefox, webkit]
include:
- os: ubuntu-latest
python-version: 3.9
browser: chromium
- os: windows-latest
python-version: 3.9
browser: chromium
- os: macos-latest
python-version: 3.9
browser: chromium
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: microsoft/playwright-github-action@v1
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Get Node PKG Cache dir
id: node-pkg-cache
run: |
node -e "const path = require('path'); const fs = require('fs'); const cachePath = path.join(os.tmpdir(), 'pkg-cache'); fs.mkdirSync(cachePath); console.log('::set-output name=dir::' + cachePath)"
- name: Cache driver
id: cache-primes
uses: actions/cache@v2
with:
path: ${{ steps.node-pkg-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r local-requirements.txt
pip install -e .
- name: Build driver
run: python build_driver.py
env:
PKG_CACHE_PATH: ${{ steps.node-pkg-cache.outputs.dir }}
- name: Build package
run: python build_package.py
- name: Install
run: python -m playwright install
- name: Test
if: matrix.os != 'ubuntu-latest'
run: pytest -vv --browser=${{ matrix.browser }} --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.browser }}.xml --timeout 90
- name: Test
if: matrix.os == 'ubuntu-latest'
run: xvfb-run pytest -vv --browser=${{ matrix.browser }} --junitxml=junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.browser }}.xml --timeout 90
- name: Upload pytest test results
uses: actions/upload-artifact@v1
with:
name: pytest-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.browser }}.xml
path: junit/test-results-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.browser }}.xml
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
test-package-installations:
name: Test package installations
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- uses: microsoft/playwright-github-action@v1
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r local-requirements.txt
pip install -e .
- name: Build driver
run: python build_driver.py
- name: Build package
run: python build_package.py
- name: Test package installation
run: bash buildbots/test-package-installations.sh