-
-
Notifications
You must be signed in to change notification settings - Fork 460
193 lines (168 loc) · 6.33 KB
/
test.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
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: "Tests"
on:
push:
branches:
- master
paths-ignore:
- CHANGELOG.md
- README.md
- LICENSE
- LICENSE.txt
- release-process.rst
- .gitignore
- .coveragerc
- .github/workflows/deploy.yml
- .github/workflows/codeql-analysis.yml
- .github/workflows/FUNDING.yml
- setup.cfg
- setup.py
- webdriver_manager/__init__.py
pull_request:
branches:
- master
paths-ignore:
- CHANGELOG.md
- README.md
- LICENSE
- LICENSE.txt
- release-process.rst
- .gitignore
- .coveragerc
- .github/workflows/deploy.yml
- .github/workflows/codeql-analysis.yml
- .github/workflows/FUNDING.yml
- setup.cfg
- setup.py
- webdriver_manager/__init__.py
jobs:
test:
runs-on: ${{ matrix.os }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
python-version: ['3.11']
selenium-version: ['4.10.0']
os: [ windows-latest ]
wdm-log: ['']
include:
- python-version: '3.11'
selenium-version: '4.10.0'
os: ubuntu-latest
- python-version: '3.11'
selenium-version: '4.10.0'
os: macos-latest
wdm-log: '0'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install browsers on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install software-properties-common apt-transport-https wget curl
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main"
sudo apt-get update && sudo apt install microsoft-edge-beta
wget -qO- https://deb.opera.com/archive.key | sudo apt-key add -
sudo add-apt-repository "deb [arch=i386,amd64] https://deb.opera.com/opera-stable/ stable non-free"
sudo apt-get update
sudo apt-get -y --no-install-recommends install opera-stable
sudo apt-get install chromium-browser
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list
sudo apt update
sudo apt install brave-browser
- name: Check browser versions on Linux
if: runner.os == 'Linux'
run: |
google-chrome --version
microsoft-edge --version
opera --version
chromium --version
brave-browser --version
- name: Install browsers on Windows
if: runner.os == 'Windows'
shell: powershell
run: |
choco install chromium opera brave googlechrome --no-progress -y --force
- name: Install browsers on MacOS
if: startsWith(runner.os, 'macOS')
run: |
brew tap domt4/chromium
brew update
brew install --cask mac-chromium opera brave-browser
brew upgrade google-chrome
- name: Install Python dependencies
run: |
python -m pip install -U pip wheel
pip install pipenv
pipenv install --dev --skip-lock --python=${{ matrix.python-version }}
pipenv install selenium==${{ matrix.selenium-version }}
- name: Run tests on Linux (with xvfb)
if: runner.os == 'Linux'
env:
WDM_LOG: ${{ matrix.wdm-log }}
uses: coactions/setup-xvfb@v1
with:
run: |
pipenv run py.test -sv --cov-config .coveragerc --cov-report xml --cov-report term:skip-covered --cov=webdriver_manager --tb=short tests/
- name: Run tests on Windows (without xvfb)
if: runner.os == 'Windows'
run: |
pipenv run py.test -sv --cov-config .coveragerc --cov-report xml --cov-report term:skip-covered --cov=webdriver_manager --tb=short tests/
- name: Run tests on MacOS (without xvfb)
if: startsWith(runner.os, 'macOS')
run: |
pipenv run py.test -sv --cov-config .coveragerc --cov-report xml --cov-report term:skip-covered --cov=webdriver_manager --tb=short tests/
- name: Codecov Upload
uses: codecov/codecov-action@v3
if: always()
with:
file: ./coverage.xml
name: ${{ matrix.os }}-py${{ matrix.python-version }}
test-negative:
runs-on: ${{ matrix.os }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
python-version: [ '3.7' ]
selenium-version: [ '3.141.0' ]
os: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Uninstall browsers
run: |
sudo apt remove firefox google-chrome-stable -y
sudo apt autoremove && sudo apt autoclean -y
sudo apt clean
- name: Install Python dependencies
run: |
python -m pip install -U pip wheel
pip install pipenv
pipenv install --dev --skip-lock --python=${{ matrix.python-version }}
pipenv install selenium==${{ matrix.selenium-version }}
- name: Run tests on Linux (with xvfb)
if: runner.os == 'Linux'
uses: coactions/setup-xvfb@v1
with:
run: |
pipenv run py.test -sv --cov-config .coveragerc --cov-report xml --cov-report term:skip-covered --cov=webdriver_manager --tb=short tests_negative/
- name: Codecov Upload
uses: codecov/codecov-action@v3
if: always()
with:
file: ./coverage.xml
name: ${{ matrix.os }}-py${{ matrix.python-version }}