forked from mars-project/mars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
101 lines (86 loc) · 3.21 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
trigger:
branches:
include:
- '*'
pr:
- master
- v*.*
jobs:
- job: Job
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.8'
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
# todo remove this when fastparquet release new version
if [[ "$PYTHON" =~ "3.6" ]]; then
pip install numpy\<1.20.0
fi
source ./ci/rewrite-cov-config.sh
pip install numpy scipy cython
pip install -e ".[dev,distributed]"
pip install virtualenv flaky flake8
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
conda install --quiet --yes -n test -c conda-forge --no-deps python=$PYTHON \
libxgboost py-xgboost xgboost lightgbm tensorflow
pip install faiss-cpu
pip install torch torchvision
pip install statsmodels tsfresh
fi
fi
conda list -n test
displayName: 'Install dependencies'
- bash: |
set -e
source ci/reload-env.sh
pytest $PYTEST_CONFIG mars/$(mars.test.module)
coverage report
coverage xml
displayName: 'Run tests'
- bash: |
bash <(curl -s https://codecov.io/bash)
displayName: 'Upload coverage'