-
Notifications
You must be signed in to change notification settings - Fork 5
/
azure-pipelines.yml
75 lines (66 loc) · 2.56 KB
/
azure-pipelines.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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
# - bash: "sudo apt-get install -y xvfb freeglut3-dev python-opengl --fix-missing"
# displayName: 'Install ffmpeg, freeglut3-dev, and xvfb'
stages:
- stage: Test
condition: and(always(), eq(variables['Build.Reason'], 'PullRequest'))
jobs:
- job: 'Test'
pool:
vmImage: 'ubuntu-16.04' # other options: 'macOS-10.13', 'vs2017-win2016'
strategy:
matrix:
Python36:
python.version: '3.6'
# Python37: # Pyglet and gym do not working here
# python.version: '3.7.5'
maxParallel: 4
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
- bash: "sudo apt-get install -y freeglut3-dev python-opengl"
displayName: 'Install freeglut3-dev'
- script: |
python -m pip install --upgrade pip setuptools wheel pytest pytest-cov python-xlib -e .
python setup.py install
displayName: 'Install dependencies'
- script: sh ./build/azure_pipeline_helper.sh
displayName: 'Complex Installs'
- script: |
xvfb-run -s "-screen 0 1400x900x24" py.test tests --cov fast_rl --cov-report html --doctest-modules --junitxml=junit/test-results.xml --cov=./ --cov-report=xml --cov-report=html
displayName: 'Test with pytest'
- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'Publish test results for Python $(python.version)'
- stage: Deploy
condition: and(always(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
jobs:
- job: "TwineDeploy"
pool:
vmImage: 'ubuntu-16.04' # other options: 'macOS-10.13', 'vs2017-win2016'
strategy:
matrix:
Python36:
python.version: '3.6'
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
# Install python distributions like wheel, twine etc
- task: Bash@3
inputs:
targetType: 'inline'
script: |
echo $TWINE_USERNAME
pip install wheel setuptools twine
python setup.py sdist bdist_wheel
python -m twine upload -u $TWINE_USERNAME -p $TWINE_PASSWORD --repository-url 'https://upload.pypi.org/legacy/' dist/*
env:
TWINE_PASSWORD: $(SECRET_TWINE_PASSWORD)
TWINE_USERNAME: $(SECRET_TWINE_USERNAME)