2019-01-02 03:59:41 +01:00
|
|
|
# https://aka.ms/yaml
|
|
|
|
|
jobs:
|
2019-01-02 08:35:36 +01:00
|
|
|
- job: Build
|
2019-01-02 03:59:41 +01:00
|
|
|
pool:
|
|
|
|
|
vmImage: 'vs2017-win2016' # other options: 'macOS-10.13', 'ubuntu-16.04'
|
|
|
|
|
strategy:
|
|
|
|
|
matrix:
|
2019-01-02 05:45:28 +01:00
|
|
|
# Python27:
|
|
|
|
|
# python.version: '2.7'
|
2019-01-02 08:35:36 +01:00
|
|
|
cp35-cp35m-win_amd64.whl:
|
2019-01-02 05:45:28 +01:00
|
|
|
python.version: '3.5'
|
2019-01-02 05:50:18 +01:00
|
|
|
python.architecture: 'x64'
|
2019-01-02 08:35:36 +01:00
|
|
|
cp36-cp36m-win_amd64.whl:
|
2019-01-02 05:45:28 +01:00
|
|
|
python.version: '3.6'
|
2019-01-02 05:50:18 +01:00
|
|
|
python.architecture: 'x64'
|
2019-01-02 08:35:36 +01:00
|
|
|
cp37-cp37m-win_amd64.whl:
|
2019-01-02 05:47:47 +01:00
|
|
|
python.version: '3.7'
|
2019-01-02 05:50:18 +01:00
|
|
|
python.architecture: 'x64'
|
2019-01-02 08:35:36 +01:00
|
|
|
cp35-cp35m-win32.whl:
|
2019-01-02 05:50:18 +01:00
|
|
|
python.version: '3.5'
|
|
|
|
|
python.architecture: 'x86'
|
2019-01-02 08:35:36 +01:00
|
|
|
cp36-cp36m-win32.whl:
|
2019-01-02 05:50:18 +01:00
|
|
|
python.version: '3.6'
|
|
|
|
|
python.architecture: 'x86'
|
2019-01-02 08:35:36 +01:00
|
|
|
cp37-cp37m-win32.whl:
|
2019-01-02 05:50:18 +01:00
|
|
|
python.version: '3.7'
|
|
|
|
|
python.architecture: 'x86'
|
|
|
|
|
maxParallel: 6
|
2019-01-02 03:59:41 +01:00
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
|
inputs:
|
|
|
|
|
versionSpec: '$(python.version)'
|
2019-01-02 05:50:18 +01:00
|
|
|
architecture: '$(python.architecture)'
|
2019-01-02 03:59:41 +01:00
|
|
|
|
|
|
|
|
# Add additional tasks to run using each Python version in the matrix above
|
|
|
|
|
|
|
|
|
|
# PowerShell
|
|
|
|
|
# Run a PowerShell script on Windows, macOS, or Linux.
|
|
|
|
|
- task: PowerShell@2
|
|
|
|
|
inputs:
|
|
|
|
|
targetType: 'inline' # Optional. Options: filePath, inline
|
|
|
|
|
#arguments: # Optional
|
|
|
|
|
script: | # Required when targetType == Inline
|
|
|
|
|
pwd
|
2019-01-04 09:31:05 +01:00
|
|
|
Invoke-WebRequest -Uri "https://dl.bintray.com/lightwave-lab/klayout/klayout-microbits-1.0.zip" -OutFile klayout-microbits-1.0.zip
|
2019-01-02 03:59:41 +01:00
|
|
|
dir
|
|
|
|
|
Expand-Archive klayout-microbits-1.0.zip -DestinationPath klayout-microbits
|
|
|
|
|
dir klayout-microbits
|
|
|
|
|
#errorActionPreference: 'stop' # Optional. Options: stop, continue, silentlyContinue
|
|
|
|
|
#failOnStderr: false # Optional
|
|
|
|
|
#ignoreLASTEXITCODE: false # Optional
|
|
|
|
|
#pwsh: false # Optional
|
|
|
|
|
#workingDirectory: # Optional
|
2019-01-02 06:34:56 +01:00
|
|
|
displayName: 'Download and Extract KLayout bits'
|
2019-01-02 03:59:41 +01:00
|
|
|
|
2019-01-02 05:45:28 +01:00
|
|
|
# - script: |
|
|
|
|
|
# curl https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi -o VCForPython27.msi
|
|
|
|
|
# msiexec /i VCForPython27.msi /quiet
|
|
|
|
|
# set "VS90COMNTOOLS=C:\Users\VssAdministrator\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC"
|
|
|
|
|
# curl https://raw.githubusercontent.com/mattn/gntp-send/master/include/msinttypes/stdint.h -o "%VS90COMNTOOLS%\Include\stdint.h"
|
|
|
|
|
# dir "%VS90COMNTOOLS%\Include"
|
|
|
|
|
# condition: eq(variables['python.version'], '2.7')
|
2019-01-02 06:34:56 +01:00
|
|
|
# displayName: 'Install Microsoft Visual C++ Compiler for Python 2.7'
|
2019-01-02 04:40:33 +01:00
|
|
|
|
2019-01-02 04:11:02 +01:00
|
|
|
- script: |
|
2019-01-02 05:50:18 +01:00
|
|
|
python -m pip install --upgrade pip setuptools wheel
|
2019-01-02 06:34:56 +01:00
|
|
|
displayName: 'Update pip, setuptools and wheel'
|
2019-01-02 04:11:02 +01:00
|
|
|
|
2019-01-02 03:59:41 +01:00
|
|
|
- script: |
|
|
|
|
|
python -V
|
2019-01-02 05:50:18 +01:00
|
|
|
set "KLAYOUT_BITS=%cd%\klayout-microbits\klayout-microbits-1.0\msvc2017\%PYTHON_ARCHITECTURE%"
|
|
|
|
|
echo KLAYOUT_BITS=%KLAYOUT_BITS%
|
2019-01-02 06:34:56 +01:00
|
|
|
python setup.py bdist_wheel
|
2019-01-02 06:09:27 +01:00
|
|
|
displayName: 'Build KLayout'
|
|
|
|
|
|
2019-01-02 06:34:56 +01:00
|
|
|
- bash: |
|
|
|
|
|
bash `pwd`/ci-scripts/windows/fix_wheel.sh `pwd`/dist/*.whl "`pwd`/klayout-microbits/klayout-microbits-1.0/msvc2017/$PYTHON_ARCHITECTURE"
|
|
|
|
|
displayName: 'Copy klayout bits dlls into wheel'
|
|
|
|
|
|
2019-01-02 06:09:27 +01:00
|
|
|
- script: |
|
2019-01-02 06:34:56 +01:00
|
|
|
echo PATH=%PATH%
|
|
|
|
|
pip install klayout --no-index -f dist
|
2019-01-02 06:09:27 +01:00
|
|
|
python testdata/pymod/import_db.py
|
|
|
|
|
python testdata/pymod/import_rdb.py
|
|
|
|
|
python testdata/pymod/import_tl.py
|
|
|
|
|
python testdata/pymod/pya_tests.py
|
|
|
|
|
displayName: 'Test KLayout pymod'
|
2019-01-02 07:25:08 +01:00
|
|
|
|
|
|
|
|
- task: CopyFiles@2
|
|
|
|
|
condition: always()
|
|
|
|
|
inputs:
|
|
|
|
|
sourceFolder: '$(Build.SourcesDirectory)'
|
|
|
|
|
targetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
|
contents: '**/?(*.whl)'
|
|
|
|
|
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
|
condition: always()
|
|
|
|
|
inputs:
|
|
|
|
|
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
2019-01-02 07:53:42 +01:00
|
|
|
artifactName: 'wheel-$(python.version).$(python.architecture)'
|
2019-01-02 08:35:36 +01:00
|
|
|
|
|
|
|
|
- job: 'Deploy'
|
|
|
|
|
displayName: 'Combine Windows wheels'
|
|
|
|
|
dependsOn: Build
|
|
|
|
|
pool:
|
|
|
|
|
vmImage: 'vs2017-win2016' # other options: 'macOS-10.13', 'ubuntu-16.04'
|
|
|
|
|
steps:
|
|
|
|
|
- checkout: none #skip checking out the default repository resource
|
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
|
displayName: 'Download Build Artifacts wheel-3.7.x64'
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: 'wheel-3.7.x64'
|
|
|
|
|
downloadPath: '$(System.DefaultWorkingDirectory)'
|
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
|
displayName: 'Download Build Artifacts wheel-3.6.x64'
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: 'wheel-3.6.x64'
|
|
|
|
|
downloadPath: '$(System.DefaultWorkingDirectory)'
|
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
|
displayName: 'Download Build Artifacts wheel-3.5.x64'
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: 'wheel-3.5.x64'
|
|
|
|
|
downloadPath: '$(System.DefaultWorkingDirectory)'
|
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
|
displayName: 'Download Build Artifacts wheel-3.7.x86'
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: 'wheel-3.7.x86'
|
|
|
|
|
downloadPath: '$(System.DefaultWorkingDirectory)'
|
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
|
displayName: 'Download Build Artifacts wheel-3.6.x86'
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: 'wheel-3.6.x86'
|
|
|
|
|
downloadPath: '$(System.DefaultWorkingDirectory)'
|
|
|
|
|
- task: DownloadBuildArtifacts@0
|
|
|
|
|
displayName: 'Download Build Artifacts wheel-3.5.x86'
|
|
|
|
|
inputs:
|
|
|
|
|
artifactName: 'wheel-3.5.x86'
|
|
|
|
|
downloadPath: '$(System.DefaultWorkingDirectory)'
|
|
|
|
|
- task: CopyFiles@2
|
|
|
|
|
condition: always()
|
|
|
|
|
inputs:
|
|
|
|
|
sourceFolder: '$(System.DefaultWorkingDirectory)'
|
|
|
|
|
targetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
|
contents: '**/?(*.whl)'
|
|
|
|
|
flattenFolders: true
|
|
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
|
condition: always()
|
|
|
|
|
inputs:
|
|
|
|
|
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
|
artifactName: 'windows_wheels'
|
|
|
|
|
|