@@ -27,87 +27,18 @@ jobs:
2727 DISPLAY : ' :99.0'
2828 PYANSYS_OFF_SCREEN : True
2929 DPF_PORT : 32772
30- DPF_START_SERVER : False
3130 pool :
3231 vmImage : ' windows-2019'
3332
34- steps :
35- - powershell : |
36- Set-StrictMode -Version Latest
37- $ErrorActionPreference = "Stop"
38- $PSDefaultParameterValues['*:ErrorAction']='Stop'
39- git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
40- powershell gl-ci-helpers/appveyor/install_opengl.ps1
41- displayName: 'Install OpenGL'
42-
43- - powershell : |
44- .ci/setup_headless_display.sh
45- pip install -r .ci/requirements_test_xvfb.txt
46- python .ci/display_test.py
47- displayName: Install test offscreen rendering
48-
49- - task : UsePythonVersion@0
50- inputs :
51- versionSpec : $(python.version)
52- addToPath : true
53-
54- - task : PipAuthenticate@1
55- inputs :
56- artifactFeeds : ' pyansys'
57- onlyAddExtraIndex : true
58-
59- - script : |
60- pip install -r requirements_build.txt
61- python setup.py bdist_wheel
62- FOR /F %%a in ('dir /s/b dist\*.whl') do SET WHEELNAME=%%a
63- ECHO %WHEELNAME%
64- echo "##vso[task.setvariable variable=WHEELNAME]$(WHEELNAME)"
65- pip install %WHEELNAME%
66- cd tests
67- python -c "from ansys.dpf import core; print(core.Report(gpu=False))"
68- displayName: Install ansys-dpf-core
69-
70- - task : PublishBuildArtifacts@1
71- displayName : ' WHEEL: publish artifacts'
72- inputs :
73- PathtoPublish : $(WHEELNAME)
74- ArtifactName : $(WHEELNAME)
75- enabled : true
76-
77- - script : |
78- pip install -r requirements_docs.txt
79- cd .ci
80- START build_doc.bat
81-
82- displayName: Build Documentation
33+ steps :
34+ - template : templates\prepare-environment-windows.yml
8335
84- - script : ' 7z.exe a doc_ansys-dpf-core.zip .\docs\build'
85- displayName : ' DOCUMENTATION: zip artifacts'
86-
8736 - task : PublishBuildArtifacts@1
88- displayName : ' DOCUMENTATION : publish artifacts'
37+ displayName : ' WHEEL : publish artifacts'
8938 inputs :
90- PathtoPublish : ' doc_ansys-dpf-core.zip '
91- ArtifactName : doc_ansys-dpf-core.zip
39+ PathtoPublish : ' $(System.DefaultWorkingDirectory)\dist '
40+ ArtifactName : ' ansys_dpf_core_wheel '
9241 enabled : true
93-
94- - task : UniversalPackages@0
95- inputs :
96- command : ' download'
97- downloadDirectory : ' $(System.DefaultWorkingDirectory)'
98- feedsToUse : ' internal'
99- vstsFeed : ' 705e121a-9631-49f5-8aaf-c7142856f923'
100- vstsFeedPackage : ' dpf-windows' # TODO: update hash of packages
101- vstsPackageVersion : ' 21.2.3'
102-
103- - script : |
104- @echo on
105- dir $(System.DefaultWorkingDirectory)\server\v212\aisol\bin\winx64
106- set THISDIR=$(System.DefaultWorkingDirectory)
107- cd %THISDIR%\server\v212\aisol\bin\winx64
108- START /B Ans.Dpf.Grpc.bat --address 127.0.0.1 --port %DPF_PORT% > log.txt 2>&1
109- python -c "from ansys.dpf import core; core.connect_to_server(port=$(DPF_PORT)); print('Python Connected')"
110- displayName: Start DPF Server
11142
11243 - script : |
11344 pip install -r requirements_test.txt
@@ -125,20 +56,25 @@ jobs:
12556 testRunTitle : ' windowsTests'
12657 publishRunAttachments : true
12758 condition : always()
59+
60+ - script : |
61+ pip install twine
62+ python setup.py sdist
63+ twine upload --skip-existing dist/*
64+ displayName: 'Upload to PyPi'
65+ condition: contains(variables['Build.SourceBranch'], 'refs/tags/')
66+ env:
67+ TWINE_USERNAME: __token__
68+ TWINE_PASSWORD: $(PYPI_TOKEN)
69+ TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"
12870
12971
13072 - script : |
13173 type $(System.DefaultWorkingDirectory)\server\v212\aisol\bin\winx64\log.txt
13274 displayName: 'Show DPF Server Logs'
133- condition: always()
75+ condition: always()
13476
135- - script : |
136- tasklist /FI "IMAGENAME eq Ans.Dpf.Grpc.exe" 2>NUL | find /I /N "Ans.Dpf.Grpc.exe">NUL
137- ECHO %ERRORLEVEL%
138- if "%ERRORLEVEL%"=="0"(taskkill /f /im Ans.Dpf.Grpc.exe)
139- displayName: 'Kill all servers'
140- condition: always()
141- continueOnError: true
77+ - template : templates\kill-servers-windows.yml
14278
14379
14480- job : Linux
@@ -234,18 +170,8 @@ jobs:
234170 publishRunAttachments : true
235171 searchFolder : ' tests/'
236172 condition : always()
237-
238- - script : |
239- pip install twine
240- python setup.py sdist
241- twine upload --skip-existing dist/*
242- displayName: 'Upload to PyPi'
243- condition: contains(variables['Build.SourceBranch'], 'refs/tags/')
244- env:
245- TWINE_USERNAME: __token__
246- TWINE_PASSWORD: $(PYPI_TOKEN)
247- TWINE_REPOSITORY_URL: "https://upload.pypi.org/legacy/"
248-
173+
174+
249175 - script : |
250176 echo $0
251177 if pgrep -x "Ans.Dpf.Grpc" > /dev/null
@@ -255,5 +181,65 @@ jobs:
255181 displayName: 'Kill all servers'
256182 condition: always()
257183 continueOnError: true
258-
184+
185+
186+ - job : DocumentationWindows
187+ variables :
188+ python.version : ' 3.8'
189+ DISPLAY : ' :99.0'
190+ PYANSYS_OFF_SCREEN : True
191+ DPF_PORT : 32772
192+ GH_DOC_BRANCH : ' cbellot/doc_try'
193+ pool :
194+ vmImage : ' windows-2019'
195+
196+ steps :
197+ - template : templates\prepare-environment-windows.yml
198+
199+ - script : |
200+ pip install -r requirements_docs.txt
201+ cd .ci
202+ dir
203+ set THISDIR=$(System.DefaultWorkingDirectory)
204+ set AWP_ROOT212=%THISDIR%\server\v212
205+ ECHO %AWP_ROOT212%
206+ build_doc.bat
207+ displayName: Build Documentation
208+
209+ - task : ArchiveFiles@2
210+ inputs :
211+ rootFolderOrFile : ' $(System.DefaultWorkingDirectory)\docs\build'
212+ includeRootFolder : false
213+ archiveType : ' zip'
214+ archiveFile : ' $(System.DefaultWorkingDirectory)\docs\archive\doc-ansys-dpf-core.zip'
215+ replaceExistingArchive : true
216+ displayName : ' DOCUMENTATION: zip artifacts'
217+
218+ - task : PublishBuildArtifacts@1
219+ displayName : ' DOCUMENTATION: publish artifacts'
220+ inputs :
221+ PathtoPublish : ' $(System.DefaultWorkingDirectory)\docs\archive'
222+ ArtifactName : doc-ansys-dpf-core
223+ enabled : true
224+
225+ - powershell : |
226+ git init
227+ git checkout -b $(GH_DOC_BRANCH)
228+ git config --local user.name "pyansys-ci-bot"
229+ git config --local user.email "$(GH_EMAIL)"
230+ git config --local http.https://github.com/.extraheader "AUTHORIZATION: Basic ${GH_PAT}"
231+ New-Item -ItemType file .nojekyll
232+ git add .
233+ git commit -m "Documentation generated by $(Build.DefinitionName)"
234+ displayName: "Init git and add docs"
235+ workingDirectory: docs\build\html
236+
237+ - script : |
238+ git remote add origin https://github.com/pyansys/DPF-Core-docs.git
239+ git push -u origin $(GH_DOC_BRANCH) --force
240+ displayName: "Publish GitHub Pages merge commit"
241+ workingDirectory: docs\build\html
242+
243+ - template : templates\kill-servers-windows.yml
244+
259245
0 commit comments