forked from hyperspy/hyperspy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
85 lines (76 loc) · 2.43 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
76
77
78
79
80
81
82
83
84
85
variables:
MPLBACKEND: agg # Necessary when running test which generate matplotlib figure
ENV_NAME: test_env
RESULT_IMAGES_FOLDER: 'result_images'
trigger:
tags:
include:
# build on any tag
- '*'
branches:
include:
# build on all branches
- '*'
resources:
repositories:
- repository: templates
type: github
name: hyperspy/ci-scripts
# For more details on service connection endpoint, see
# https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints
endpoint: hyperspy # Azure DevOps service connection
ref: use_mamba
strategy:
matrix:
Linux_Python39:
vmImage: 'ubuntu-latest'
PYTHON_VERSION: '3.9'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
Linux_Python310:
vmImage: 'ubuntu-latest'
PYTHON_VERSION: '3.10'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
MacOS_Python39:
vmImage: 'macOS-latest'
PYTHON_VERSION: '3.9'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
MacOS_Python310:
vmImage: 'macOS-latest'
PYTHON_VERSION: '3.10'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
Windows_Python39:
vmImage: 'windows-latest'
PYTHON_VERSION: '3.9'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)\mambaforge
Windows_Python310:
vmImage: 'windows-latest'
PYTHON_VERSION: '3.10'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)\mambaforge
pool:
vmImage: '$(vmImage)'
steps:
- checkout: self
fetchDepth: '1' # Fetch only one commit
- template: azure_pipelines/clone_ci-scripts_repo.yml@templates
- template: azure_pipelines/install_mambaforge.yml@templates
- template: azure_pipelines/activate_conda.yml@templates
- template: azure_pipelines/setup_anaconda_packages.yml@templates
- bash: |
source activate $ENV_NAME
pip install --no-deps -e .
conda list
displayName: Install package
- bash: |
source activate $ENV_NAME
conda clean --all -y
displayName: Clean conda cache
# Note we must use `-n 2` argument for pytest-xdist due to
# https://github.com/pytest-dev/pytest-xdist/issues/9.
- bash: |
source activate $ENV_NAME
pytest --mpl --pyargs hyperspy --reruns 3 --instafail --mpl-results-path $RESULT_IMAGES_FOLDER
displayName: Run test suite
- publish: $(System.DefaultWorkingDirectory)/$(RESULT_IMAGES_FOLDER)
artifact: $(Agent.JobName)-result_images
displayName: Publish Image Comparison
condition: failed()