11# https://docs.microsoft.com/azure/devops/pipelines/ecosystems/python
22pool :
33 vmImage : " ubuntu-16.04"
4+ strategy :
5+ matrix :
6+ lint :
7+ REPO_TYPE : ' lint'
8+ python_version : ' 3.6'
9+ unit :
10+ REPO_TYPE : ' unit'
11+ python_version : ' 3.6'
12+ base :
13+ REPO_TYPE : ' base'
14+ python_version : ' 3.6'
15+ conda :
16+ REPO_TYPE : ' conda'
17+ python_version : ' 3.6'
18+ pipfile :
19+ REPO_TYPE : ' pipfile'
20+ python_version : ' 3.6'
21+ venv :
22+ REPO_TYPE : ' venv'
23+ python_version : ' 3.6'
24+ stencila_r :
25+ REPO_TYPE : ' stencila-r'
26+ python_version : ' 3.6'
27+ stencila_py :
28+ REPO_TYPE : ' stencila-py'
29+ python_version : ' 3.6'
30+ julia :
31+ REPO_TYPE : ' julia'
32+ python_version : ' 3.6'
33+ r :
34+ REPO_TYPE : ' r'
35+ python_version : ' 3.6'
36+ nix :
37+ REPO_TYPE : ' nix'
38+ python_version : ' 3.6'
39+ dockerfile :
40+ REPO_TYPE : ' dockerfile'
41+ python_version : ' 3.6'
42+ external :
43+ REPO_TYPE : ' external'
44+ python_version : ' 3.6'
445
546steps :
647- task : UsePythonVersion@0
748 inputs :
8- versionSpec : ' 3.6 '
49+ versionSpec : $(python_version)
950
1051- script : |
1152 git config --global user.email "[email protected] " @@ -19,8 +60,21 @@ steps:
1960 displayName : ' Install dev requirements'
2061
2162- script : pip install -e .
22- displayName : ' Install r2d '
63+ displayName : ' Install repo2docker '
2364
24- # venv conda
25- - script : pytest --durations 10 --cov repo2docker -vs tests/unit
26- displayName : ' Run pytest'
65+ - script : pushd tests; pytest --durations 10 --cov repo2docker -v $(REPO_TYPE); popd
66+ displayName : ' Run tests $(REPO_TYPE)'
67+
68+ - script : |
69+ # point to auto-lint-fix
70+ if [[ "$REPO_TYPE" == "lint" ]]; then
71+ echo "You can install pre-commit hooks to automatically run formatting"
72+ echo "on each commit with:"
73+ echo " pre-commit install"
74+ echo "or you can run by hand on staged files with"
75+ echo " pre-commit run"
76+ echo "or after-the-fact on already committed files with"
77+ echo " pre-commit run --all-files"
78+ fi
79+ displayName : ' Help to debug linter errors'
80+ condition : failed()
0 commit comments