Skip to content

Commit 77f8aec

Browse files
committed
build, package and release documentation
1 parent f5c2971 commit 77f8aec

14 files changed

+158
-277
lines changed

.ci/azure-pipelines.yml

Lines changed: 81 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -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

.ci/build_doc.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
ECHO %AWP_ROOT212%
12
set SPHINX_APIDOC_OPTIONS=inherited-members
23
call sphinx-apidoc -o ../docs/source/api ../ansys ../ansys/dpf/core/aeneid.py -f --implicit-namespaces --separate --no-headings
34
pushd .
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
steps:
2+
- script : |
3+
tasklist /FI "IMAGENAME eq Ans.Dpf.Grpc.exe" 2>NUL | find /I /N "Ans.Dpf.Grpc.exe">NUL
4+
ECHO %ERRORLEVEL%
5+
if "%ERRORLEVEL%"=="0"(taskkill /f /im Ans.Dpf.Grpc.exe)
6+
displayName: 'Kill all servers'
7+
condition: always()
8+
continueOnError: true
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
steps:
2+
- powershell: |
3+
Set-StrictMode -Version Latest
4+
$ErrorActionPreference = "Stop"
5+
$PSDefaultParameterValues['*:ErrorAction']='Stop'
6+
git clone --depth 1 git://github.com/pyvista/gl-ci-helpers.git
7+
powershell gl-ci-helpers/appveyor/install_opengl.ps1
8+
displayName: 'Install OpenGL'
9+
10+
- powershell: |
11+
.ci/setup_headless_display.sh
12+
pip install -r .ci/requirements_test_xvfb.txt
13+
python .ci/display_test.py
14+
displayName: Install test offscreen rendering
15+
16+
- task: UsePythonVersion@0
17+
inputs:
18+
versionSpec: $(python.version)
19+
addToPath: true
20+
21+
- task: PipAuthenticate@1
22+
inputs:
23+
artifactFeeds: 'pyansys'
24+
onlyAddExtraIndex: true
25+
26+
- script: |
27+
pip install -r requirements_build.txt
28+
python setup.py bdist_wheel
29+
FOR /F %%a in ('dir /s/b dist\*.whl') do SET WHEELPATH=%%a
30+
ECHO %WHEELPATH%
31+
pip install %WHEELPATH%
32+
cd tests
33+
python -c "from ansys.dpf import core; print(core.Report(gpu=False))"
34+
35+
displayName: Install ansys-dpf-core
36+
37+
- task: PublishBuildArtifacts@1
38+
displayName: 'WHEEL: publish artifacts'
39+
inputs:
40+
PathtoPublish: '$(System.DefaultWorkingDirectory)\dist'
41+
ArtifactName: 'ansys_dpf_core_wheel'
42+
enabled: true
43+
44+
- task: UniversalPackages@0
45+
inputs:
46+
command: 'download'
47+
downloadDirectory: '$(System.DefaultWorkingDirectory)'
48+
feedsToUse: 'internal'
49+
vstsFeed: '705e121a-9631-49f5-8aaf-c7142856f923'
50+
vstsFeedPackage: 'dpf-windows'
51+
vstsPackageVersion: '21.2.3'
52+
53+
- script: |
54+
@echo on
55+
dir $(System.DefaultWorkingDirectory)\server\v212\aisol\bin\winx64
56+
set THISDIR=$(System.DefaultWorkingDirectory)
57+
cd %THISDIR%\server\v212\aisol\bin\winx64
58+
START /B Ans.Dpf.Grpc.bat --address 127.0.0.1 --port %DPF_PORT% > log.txt 2>&1
59+
python -c "from ansys.dpf import core; core.connect_to_server(port=$(DPF_PORT)); print('Python Connected')"
60+
displayName: Start DPF Server

.github/workflows/ci-build.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
run: |
2121
pip install -r requirements_style.txt --disable-pip-version-check
2222
make
23-
- continueOnError: true
23+
continue-on-error: true

0 commit comments

Comments
 (0)