-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
122 lines (106 loc) · 3.41 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
trigger:
branches:
include:
- master
- releases/*
- refs/tags/*
- refs/heads/*
jobs:
- job: Windows
pool:
vmImage: 'VS2017-Win2016'
strategy:
maxParallel: 2
matrix:
Python36:
PYTHON_VERSION: '3.6'
PYTHON_ARCH: 'x64'
RUSTUP_TOOLCHAIN: nightly
TEST_MODE: fast
BITS: 64
Python37:
PYTHON_VERSION: '3.7'
RUSTUP_TOOLCHAIN: nightly
PYTHON_ARCH: 'x64'
TEST_MODE: fast
BITS: 64
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(PYTHON_VERSION)'
addToPath: true
architecture: '$(PYTHON_ARCH)'
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
set PATH=%PATH%;%USERPROFILE%\.cargo\bin
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
displayName: Install rust (windows)
- script: cargo test --verbose
displayName: 'Cargo Test'
- script: |
cargo clean
pip install setuptools-rust setuptools pytest wheel
python setup.py test
displayName: "Python Test"
- script: |
cargo clean
pip install twine
python setup.py build_ext
python -m pip -v wheel . -w .\\dist
dir dist
displayName: "Build wheels"
- task: DownloadSecureFile@1
inputs:
secureFile: .pypirc
- script: 'twine upload --config-file $(Agent.TempDirectory)\.pypirc --skip-existing .\\dist\*'
displayName: "Publish to PyPI"
condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'))
- job: Linux
pool:
vmImage: 'Ubuntu 16.04'
strategy:
maxParallel: 2
matrix:
Python36:
PYTHON_VERSION: '3.6'
RUSTUP_TOOLCHAIN: nightly
TEST_MODE: fast
Python37:
PYTHON_VERSION: '3.7'
RUSTUP_TOOLCHAIN: nightly
TEST_MODE: fast
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(PYTHON_VERSION)'
addToPath: true
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $(RUSTUP_TOOLCHAIN)
export PATH=$PATH:$HOME/.cargo/bin
displayName: 'Install rustc'
- script: |
export PATH=$PATH:$HOME/.cargo/bin
cargo test --verbose
displayName: 'Cargo Test'
- script: |
export PATH=$PATH:$HOME/.cargo/bin
cargo clean
pip install setuptools-rust setuptools pytest wheel==0.31.1
python setup.py test
displayName: "Python Test"
- script: |
export PATH=$PATH:$HOME/.cargo/bin
pip install twine
cargo clean
docker run --rm -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 bash /io/build-wheels.sh
displayName: "Build wheels"
- task: DownloadSecureFile@1
inputs:
secureFile: .pypirc
- task: TwineAuthenticate@0
inputs:
artifactFeeds: 'https://pypi.org/'
- script: 'twine upload --config-file $(Agent.TempDirectory)/.pypirc --skip-existing ./dist/*-manylinux*.whl'
displayName: "Publish to PyPI"
condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'))