forked from simpeg/discretize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
125 lines (116 loc) · 3.74 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
trigger:
branches:
include:
- '*'
exclude:
- '*no-ci*'
tags:
include:
- '*'
pr:
branches:
include:
- '*'
exclude:
- '*no-ci*'
stages:
- stage: Testing
jobs:
- template: ./.azure-pipelines/azure-pipelines-linux.yml
- template: ./.azure-pipelines/azure-pipelines-osx.yml
- template: ./.azure-pipelines/azure-pipelines-win.yml
- stage: Deploy
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/'))
jobs:
- job:
displayName: Deploy Docs and source
pool:
vmImage: ubuntu-latest
variables:
DISPLAY: ':99.0'
PYVISTA_OFF_SCREEN: 'True'
steps:
- bash: |
git config --global user.name ${GH_NAME}
git config --global user.email ${GH_EMAIL}
git config --list | grep user.
displayName: 'Configure git'
env:
GH_NAME: $(gh.name)
GH_EMAIL: $(gh.email)
- bash: echo '##vso[task.prependpath]$CONDA/bin'
displayName: Add conda to PATH
- bash: sudo chown -R $USER $CONDA
displayName: Take ownership of conda installation
- bash: |
eval "$(conda shell.bash hook)"
conda update --yes --quiet -n base conda
conda install --yes --quiet -c conda-forge mamba
displayName: Install mamba
- bash: |
eval "$(conda shell.bash hook)"
mamba create --yes --quiet --name test python=3.8
conda activate test
mamba install --yes --quiet -c conda-forge numpy scipy matplotlib cython vtk pyvista pymatsolver graphviz
pip install -r requirements_dev.txt
pip install .
displayName: building and installing deps
- bash: |
eval "$(conda shell.bash hook)"
conda activate test
.ci/setup_headless_display.sh
cd docs
make html
cd ..
displayName: Building documentation
# upload documentation to discretize-docs gh-pages on tags
- bash: |
git clone --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
cd discretize-docs
git gc --prune=now
git remote prune origin
rm -rf en/main/*
cp -r $BUILD_SOURCESDIRECTORY/docs/_build/html/* en/main/
touch .nojekyll
git add .
git commit -am "Azure CI commit ref $(Build.SourceVersion)"
git push
displayName: Push documentation to discretize-docs
env:
GH_TOKEN: $(gh.token)
- bash: |
eval "$(conda shell.bash hook)"
conda activate test
python setup.py sdist
twine upload --skip-existing dist/*
displayName: Deploy source
env:
TWINE_USERNAME: $(twine.username)
TWINE_PASSWORD: $(twine.password)
- job:
displayName: Windows Wheels
strategy:
matrix:
win-Python37:
python.version: '3.7'
win-Python38:
python.version: '3.8'
win-Python39:
python.version: '3.9'
win-Python310:
python.version: '3.10'
pool:
vmImage: windows-latest
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(python.version)'
- script: pip install numpy cython twine wheel
displayName: Install build dependencies
- script: python setup.py bdist_wheel
displayName: Build Wheel
- script: twine upload --skip-existing dist/*
displayName: Upload to PYPI
env:
TWINE_USERNAME: $(twine.username)
TWINE_PASSWORD: $(twine.password)