forked from hyperspy/hyperspy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
95 lines (85 loc) · 2.9 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
86
87
88
89
90
91
92
93
94
95
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:
# Needs to update matplotlib reference image to add python3.9 build
# matplotlib 3.1 doesn't have a python 3.9 build
Linux_Python38:
vmImage: 'ubuntu-latest'
PYTHON_VERSION: '3.8'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
Linux_Python37:
vmImage: 'ubuntu-latest'
PYTHON_VERSION: '3.7'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
MacOS_Python38:
vmImage: 'macOS-latest'
PYTHON_VERSION: '3.8'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
MacOS_Python37:
vmImage: 'macOS-latest'
PYTHON_VERSION: '3.7'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
Windows_Python38:
vmImage: 'windows-latest'
PYTHON_VERSION: '3.8'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)\mambaforge
Windows_Python37:
vmImage: 'windows-latest'
PYTHON_VERSION: '3.7'
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()
- template: azure_pipelines/generate_distribution.yml@templates
- template: azure_pipelines/publish_distribution.yml@templates
# - template: azure_pipelines/update_github_release.yml@templates
# parameters:
# # Set the token generated with github from the developer settings/personal
# # access tokens menu in azure pipeline
# github_token_name: ''