This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 142
/
build.yaml
83 lines (74 loc) · 3.49 KB
/
build.yaml
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
steps:
- template: inner_eye_env.yml
- bash: |
source activate InnerEye
echo Storing environment for later use by ComponentGovernance
# This file is picked up later by ComponentGovernance
pip freeze > requirements.txt
echo Environment has been created with these packages:
cat requirements.txt
condition: succeeded()
displayName: List environment
# Pytest needs subscription information directly in settings.yml. Local package install will cause use of
# the wrong default project root, hence InnerEyePrivateSettings.yml can't be picked up.
- bash: |
sed -i -e "s/subscription_id: ''/subscription_id: '$(InnerEyeDevSubscriptionID)'/" InnerEye/settings.yml
sed -i -e "s/application_id: ''/application_id: '$(InnerEyeDeepLearningServicePrincipalID)'/" InnerEye/settings.yml
displayName: Store subscription in settings.yml
condition: succeededOrFailed()
# Install the InnerEye package without its dependencies. We have already create an environment that has everything
# the package needs. If --no-deps is omitted, this causes a weird package conflict with azure-storage-blob
- bash: |
source activate InnerEye
python setup.py develop --no-deps
env:
IS_DEV_PACKAGE: True
failOnStderr: false
condition: succeededOrFailed()
displayName: Install InnerEye (Dev) Package
# First run all tests that require the InnerEye package. All code should be consumed via the InnerEye package,
# hence don't set PYTHONPATH to InnerEye - but do set it to hi-ml if that has been included as a submodule for dev
# work on the package
- bash: |
source activate InnerEye
pytest ./Tests/ -m "not (gpu or azureml or after_training_single_run or after_training_ensemble_run or inference or after_training_2node or after_training_glaucoma_cv_run or after_training_hello_container)" --doctest-modules --junitxml=junit/test-results.xml --cov=. --cov-config=.coveragerc --cov-report=xml --verbose
env:
APPLICATION_KEY: $(InnerEyeDeepLearningServicePrincipalKey)
DATASETS_ACCOUNT_KEY: $(InnerEyePublicDatasetsStorageKey)
failOnStderr: false
condition: succeededOrFailed()
displayName: Run pytests on InnerEye package
# Run all tests for code that does not live in the InnerEye package. For that, set PYTHONPATH
- bash: |
source activate InnerEye
pytest ./TestsOutsidePackage -n 2 --dist=loadscope --verbose --junitxml=junit/test-outside-package-results.xml
env:
APPLICATION_KEY: $(InnerEyeDeepLearningServicePrincipalKey)
failOnStderr: false
condition: succeededOrFailed()
displayName: Run pytests on code outside package
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test*.xml'
testRunTitle: 'tests_on_$(Agent.OS)'
condition: succeededOrFailed()
displayName: Publish test results tests_on_$(Agent.OS)
- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/htmlcov'
condition: succeededOrFailed()
- task: ComponentGovernanceComponentDetection@0
condition: succeeded()
inputs:
scanType: 'Register'
verbosity: 'Normal'
alertWarningLevel: 'High'
failOnAlert: false
failOnStderr: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'