-
Notifications
You must be signed in to change notification settings - Fork 28
/
azure-pipelines.yml
91 lines (83 loc) · 2.79 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
variables:
ENV_NAME: test_env
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_Python310:
vmImage: 'ubuntu-latest'
PYTHON_VERSION: '3.10'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
Linux_Python39:
vmImage: 'ubuntu-latest'
PYTHON_VERSION: '3.9'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
Linux_Python38:
vmImage: 'ubuntu-latest'
PYTHON_VERSION: '3.8'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
MacOS_Python38:
vmImage: 'macOS-latest'
PYTHON_VERSION: '3.8'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
MacOS_Python310:
vmImage: 'macOS-latest'
PYTHON_VERSION: '3.10'
MAMBAFORGE_PATH: $(Agent.BuildDirectory)/mambaforge
Windows_Python38:
vmImage: 'windows-latest'
PYTHON_VERSION: '3.8'
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: '0' # Fetch all commits for setuptools_scm
fetchTags: 'true' # tags necessary for setuptools_scm
- bash: |
git remote add upstream https://github.com/hyperspy/rosettasciio.git
git fetch upstream --tags
condition: ne(variables['Build.Repository.Name'], 'hyperspy/rosettasciio')
displayName: Fetch tags from hyperspy/rosettasciio
- 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
# 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 --pyargs rsciio --reruns 3 -n 2
displayName: Run test suite
- 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: ''