Skip to content

Commit 3a2985c

Browse files
committed
Set up CI with Azure Pipelines [skip ci]
1 parent 4db3dac commit 3a2985c

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

azure-pipelines.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Test the SeleniumBase Python package with Azure Pipelines.
2+
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
3+
4+
trigger:
5+
- master
6+
7+
jobs:
8+
9+
- job: 'Test'
10+
pool:
11+
vmImage: 'Ubuntu-16.04'
12+
strategy:
13+
matrix:
14+
Python27:
15+
python.version: '2.7'
16+
Python36:
17+
python.version: '3.6'
18+
Python37:
19+
python.version: '3.7'
20+
maxParallel: 4
21+
22+
steps:
23+
- task: UsePythonVersion@0
24+
inputs:
25+
versionSpec: '$(python.version)'
26+
architecture: 'x64'
27+
28+
- script: python -m pip install --upgrade pip && pip install -r requirements.txt
29+
displayName: 'Install dependencies'
30+
31+
- script: sudo apt install google-chrome-stable
32+
displayName: 'Install Chrome'
33+
34+
- script: sudo apt-get install firefox
35+
displayName: 'Install Firefox'
36+
37+
- script: seleniumbase install chromedriver
38+
displayName: 'Install Chromedriver'
39+
40+
- script: seleniumbase install geckodriver
41+
displayName: 'Install Geckodriver (Firefox driver)'
42+
43+
- script: |
44+
pip install pytest
45+
pytest examples/my_first_test.py --browser=chrome --headless --junitxml=junit/test-results.xml
46+
pytest examples/my_first_test.py --browser=firefox --headless --junitxml=junit/test-results.xml
47+
displayName: 'pytest'
48+
49+
- task: PublishTestResults@2
50+
inputs:
51+
testResultsFiles: '**/test-results.xml'
52+
testRunTitle: 'Python $(python.version)'
53+
condition: succeededOrFailed()
54+
55+
- job: 'Publish'
56+
dependsOn: 'Test'
57+
pool:
58+
vmImage: 'Ubuntu-16.04'
59+
60+
steps:
61+
- task: UsePythonVersion@0
62+
inputs:
63+
versionSpec: '3.x'
64+
architecture: 'x64'
65+
66+
- script: python setup.py sdist
67+
displayName: 'Build sdist'

0 commit comments

Comments
 (0)