-
Notifications
You must be signed in to change notification settings - Fork 328
/
azure-pipelines.yml
204 lines (170 loc) · 5.89 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
trigger:
branches:
include:
- '*'
pr:
- master
- v*.*
jobs:
- job: CI
timeoutInMinutes: 120
cancelTimeoutInMinutes: 2
pool:
vmImage: 'ubuntu-latest'
strategy:
matrix:
DataFrame:
mars.test.module: 'dataframe'
Learn:
mars.test.module: 'learn'
Tensor:
mars.test.module: 'tensor'
variables:
PYTHON: '3.9'
steps:
- powershell: |
$header = @{ Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN" }
$buildsUrl = "$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds?api-version=6.0"
$builds = Invoke-RestMethod -Uri $buildsUrl -Method Get -Header $header
$buildsToStop = $builds.value.Where({ ($_.status -eq 'inProgress') -and ($_.sourceBranch -eq '$(Build.SourceBranch)') -and ($_.definition.name -eq '$(Build.DefinitionName)') -and ($_.id -ne '$(Build.BuildId)') })
ForEach($build in $buildsToStop)
{
$build.status = "cancelling"
$body = $build | ConvertTo-Json -Depth 10
$urlToCancel = "$(System.TeamFoundationCollectionUri)$(System.TeamProject)/_apis/build/builds/" + $build.id + "?api-version=6.0"
Write-Output "Cancelling $urlToCancel"
Invoke-RestMethod -Uri $urlToCancel -Method Patch -ContentType application/json -Header $header -Body $body -SkipHttpErrorCheck
}
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
displayName: 'Cancel previous jobs'
- bash: |
set -e
source ci/install-conda.sh
displayName: 'Install conda'
- bash: |
set -e
source ci/reload-env.sh
export DEFAULT_VENV=$VIRTUAL_ENV
if [[ ! "$PYTHON" =~ "3.9" ]]; then
conda install -n test --quiet --yes -c conda-forge python=$PYTHON numba
fi
source ./ci/rewrite-cov-config.sh
if [[ "$(mars.test.module)" == "learn" ]]; then
pip install numpy\<1.20.0 scipy cython
else
pip install numpy scipy cython
fi
pip install -e ".[dev,extra]"
pip install virtualenv flaky
if [ -z "$NO_COMMON_TESTS" ]; then
if [[ ! "$PYTHON" =~ "3.6" ]] && [[ ! "$PYTHON" =~ "3.9" ]]; then
pip install h5py zarr matplotlib fastparquet
conda install -n test --quiet --yes -c conda-forge python=$PYTHON \
"tiledb-py>=0.4.3,<0.6.0" "tiledb<2.0.0" || true
fi
conda install -n test --quiet --yes -c pkgs/main python=$PYTHON certifi
if [[ "$(mars.test.module)" == "learn" ]]; then
pip install "xgboost<1.7" lightgbm keras tensorflow "faiss-cpu<1.7.3" torch torchvision \
statsmodels tsfresh
fi
fi
conda list -n test
displayName: 'Install dependencies'
- bash: |
set -e
source ci/reload-env.sh
export CI=true
mkdir -p build
pytest $PYTEST_CONFIG mars/$(mars.test.module)
mv .coverage build/.coverage.main.file
# do compatibility test for earliest supported pandas release
if [[ "$(mars.test.module)" == "dataframe" ]]; then
pip install numpy\<1.24.0
pytest $PYTEST_CONFIG -m pd_compat mars/dataframe
mv .coverage build/.coverage.pd_compat.file
fi
coverage combine build/ && coverage report
coverage xml
displayName: 'Run tests'
- bash: |
GIT_ORIGIN="$(git config --get remote.origin.url)"
if [[ "$GIT_ORIGIN" == *"mars-project/mars"* ]]; then
export CODECOV_TOKEN="f578555e-b4f4-49a8-8d33-b21a305299ee"
fi
bash <(curl -s https://codecov.io/bash)
displayName: 'Upload coverage'
- job: Checks
timeoutInMinutes: 120
cancelTimeoutInMinutes: 2
pool:
vmImage: 'ubuntu-latest'
variables:
PYTHON: '3.9'
steps:
- bash: |
set -e
source ci/install-conda.sh
displayName: 'Install conda'
- bash: |
set -e
source ./ci/reload-env.sh
export DEFAULT_VENV=$VIRTUAL_ENV
pip install numpy scipy cython
pip install -e ".[dev,extra]"
pip install virtualenv flake8 codespell sphinx sphinx-intl black
conda list -n test
displayName: 'Install dependencies'
- bash: |
set -e
source ./ci/reload-env.sh
# stop the build if there are Python syntax errors or undefined names
flake8 mars --count --show-source --statistics
# special check for __init__.py
grep -A 10000 '\[flake8\]' setup.cfg | awk '!/(F401|F811|__init__\.py)/' > flake8_init.ini
flake8 mars --config=flake8_init.ini
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 mars --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
displayName: 'Lint with flake8'
- bash: |
set -e
source ./ci/reload-env.sh
black --check --diff --verbose mars benchmarks
displayName: 'Check code style with black'
- bash: |
set -e
source ./ci/reload-env.sh
codespell
displayName: 'Check spellings'
- bash: |
set -e
source ./ci/reload-env.sh
git fetch origin master
bash ci/modecheck.sh
displayName: 'Check file mode changes'
- bash: |
set -e
source ./ci/reload-env.sh
python ci/importcheck.py
displayName: 'Check imports'
- bash: |
set -e
source ./ci/reload-env.sh
python ci/copycheck.py
displayName: 'Check copyright headers'
- bash: |
set -e
source ./ci/reload-env.sh
pushd mars/services/web/ui
npm install
npm run lint
popd
displayName: 'Check JS with ESLint'
- bash: |
set -e
source ./ci/reload-env.sh
pushd docs
pip install -r requirements-doc.txt
make html
popd
displayName: 'Check documentation build'