Skip to content

Commit c433acf

Browse files
committed
use tox in azure-pipelines.yml
1 parent 5ee044e commit c433acf

File tree

1 file changed

+35
-23
lines changed

1 file changed

+35
-23
lines changed

azure-pipelines.yml

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,45 @@
1+
trigger:
2+
branches:
3+
include:
4+
- master
5+
pr:
6+
- "*"
7+
18
jobs:
2-
- job: unit_tests
9+
- job: pytest36
310
steps:
4-
- bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
5-
displayName: Add conda to PATH
6-
7-
- script: conda env create --quiet --file environment.yml
8-
displayName: Create Anaconda environment
9-
10-
- script: |
11-
source activate adaptive
12-
pip install -r test-requirements.txt
13-
displayName: 'Install test-requirements.txt'
14-
15-
- script: |
16-
source activate adaptive
17-
pytest --verbose --cov=adaptive --cov-report term --cov-report html adaptive
11+
- task: UsePythonVersion@0
12+
inputs:
13+
versionSpec: '3.6'
14+
- script: pip install tox
15+
displayName: 'Install tox'
16+
- script: tox -e py36
1817
displayName: 'Run the tests'
1918

20-
- job: linting_tests
19+
- job: pytest37
2120
steps:
22-
- bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
23-
displayName: Add conda to PATH
21+
- task: UsePythonVersion@0
22+
inputs:
23+
versionSpec: '3.7'
24+
- script: pip install tox
25+
displayName: 'Install tox'
26+
- script: tox -e py37
27+
displayName: 'Run the tests'
28+
- script: tox -e clean,report
29+
displayName: 'Test coverage'
2430

25-
- script: |
26-
pip install pre_commit
27-
pre-commit install
28-
pre-commit run --all-files --show-diff-on-failure
29-
displayName: 'Run pre-commit'
31+
- job: pre_commit
32+
steps:
33+
- task: UsePythonVersion@0
34+
inputs:
35+
versionSpec: '3.7'
36+
- script: pip install tox
37+
displayName: 'Install tox'
38+
- script: tox -e pre-commit
39+
displayName: 'Lining tests'
3040

41+
- job: authors_check
42+
steps:
3143
- script: |
3244
MISSING_AUTHORS=$(git shortlog -s HEAD | sed -e "s/^[0-9\t ]*//"| xargs -i sh -c 'grep -q "{}" AUTHORS.md || echo "{} missing from authors"')
3345
if [ ! -z "$MISSING_AUTHORS" ]; then { echo $MISSING_AUTHORS; exit 1; }; fi

0 commit comments

Comments
 (0)