@@ -73,17 +73,32 @@ jobs:
7373 with :
7474 python-version : ${{ inputs.python_version }}
7575
76+ - name : " Create virtual environment in the current workspace"
77+ shell : pwsh
78+ run : python -m venv .venv --system-site-packages
79+
80+ - name : " Update pip to the latest version"
81+ shell : pwsh
82+ run : |
83+ .venv\Scripts\Activate.ps1
84+ python -m pip install -U pip
85+
7686 - name : " Install requirements"
77- run : pip install -r requirements/requirements_build.txt
87+ shell : pwsh
88+ run : |
89+ .venv\Scripts\Activate.ps1
90+ python -m pip install -r requirements/requirements_build.txt
7891
7992 - name : " Build the wheel"
80- shell : bash
93+ shell : pwsh
8194 run : |
82- if [ ${{ matrix.os }} == "ubuntu-latest" ]; then
83- export platform="manylinux_2_17"
84- else
85- export platform="win"
86- fi
95+ $os = "${{ matrix.os }}"
96+ if ($os -eq "ubuntu-latest") {
97+ $platform = "manylinux_2_17"
98+ } else {
99+ $platform = "win"
100+ }
101+ .venv\Scripts\Activate.ps1
87102 python .ci/build_wheel.py -p $platform -w
88103
89104 - name : " Expose the wheel"
@@ -96,9 +111,10 @@ jobs:
96111 echo "wheel_name=${name[0]}" >> $GITHUB_OUTPUT
97112
98113 - name : " Install package wheel"
99- shell : bash
114+ shell : pwsh
100115 run : |
101- pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting]
116+ .venv\Scripts\Activate.ps1
117+ python -m pip install dist/${{ steps.wheel.outputs.wheel_name }}[plotting]
102118
103119 - name : " Install DPF"
104120 id : set-server-path
@@ -112,9 +128,11 @@ jobs:
112128 uses :
ansys/pydpf-actions/[email protected] 113129
114130 - name : " Test import"
115- shell : bash
131+ shell : pwsh
116132 working-directory : tests
117- run : python -c "from ansys.dpf import core"
133+ run : |
134+ ..\.venv\Scripts\Activate.ps1
135+ python -c "from ansys.dpf import core"
118136
119137 - name : " Setup headless display"
120138 uses : pyvista/setup-headless-display-action@v2
@@ -127,73 +145,37 @@ jobs:
127145 choco install pandoc
128146
129147 - name : " Install documentation packages for Python"
148+ shell : pwsh
149+ run : |
150+ .venv\Scripts\Activate.ps1
151+ python -m pip install -r requirements/requirements_docs.txt
152+
153+ - name : Update PATH for virtual environment
130154 run : |
131- pip install -r requirements/requirements_docs.txt
155+ echo "${{ github.workspace }}\.venv\Scripts" >> $env:GITHUB_PATH
132156
133157 - name : " Kill all servers"
134158 uses :
ansys/pydpf-actions/[email protected] 135159
136160 - name : " Ensure VTK compatibility"
161+ shell : pwsh
137162 run : |
163+ .venv\Scripts\Activate.ps1
138164 python -m pip uninstall --yes vtk
139165 python -m pip install --extra-index-url https://wheels.vtk.org vtk-osmesa==${{ env.VTK_OSMESA_VERSION }}
140166
141167 - name : " List installed packages"
142- shell : bash
143- run : pip list
168+ shell : pwsh
169+ run : |
170+ .venv\Scripts\Activate.ps1
171+ python -m pip list
144172
145173 - name : " Build HTML Documentation"
146- shell : bash
174+ shell : cmd /D /E:ON /V:OFF /C "CALL "{0}""
175+ working-directory : .ci
147176 run : |
148- # Navigate to the documentation directory
149- cd doc
150-
151- # Create a log file for output redirection
152- LOG_FILE="../doc/log.txt"
153- exec > >(tee -a "$LOG_FILE") 2>&1
154-
155- echo "Starting documentation build process..."
156-
157- # Backup files from source/examples and source/_temp/plugins before cleaning
158- echo "Backing up files before cleaning..."
159- mkdir -p source/_backup
160- [ -d "source/examples/07-python-operators/plugins" ] && cp -r source/examples/07-python-operators/plugins source/_backup/plugins || true
161- [ -d "source/examples/04-advanced/02-volume_averaged_stress" ] && cp -r source/examples/04-advanced/02-volume_averaged_stress source/_backup/04_advanced || true
162- [ -d "source/examples/12-fluids/02-fluids_results" ] && cp -r source/examples/12-fluids/02-fluids_results source/_backup/12_fluids || true
163-
164- # Clean previous builds
165- echo "Cleaning previous build artifacts..."
166- rm -rf build source/images/auto-generated source/examples
167- rm -rf source/_temp || true
168-
169- # Restore backed-up files
170- echo "Restoring backed-up files..."
171- mkdir -p source/examples/07-python-operators
172- [ -d "source/_backup/plugins" ] && cp -r source/_backup/plugins source/examples/07-python-operators/plugins || true
173- mkdir -p source/examples/04-advanced
174- [ -d "source/_backup/04_advanced" ] && cp -r source/_backup/04_advanced source/examples/04-advanced/02-volume_averaged_stress || true
175- mkdir -p source/examples/12-fluids
176- [ -d "source/_backup/12_fluids" ] && cp -r source/_backup/12_fluids source/examples/12-fluids/02-fluids_results || true
177- rm -rf source/_backup || true
178-
179- # Build the HTML documentation
180- echo "Building HTML documentation..."
181- sphinx-build -b html source build/html -v
182-
183- # Copy necessary images to the build directory
184- echo "Copying images for patching pyVista issues..."
185- mkdir -p build/html/_images
186- cp -v source/examples/04-advanced/02-volume_averaged_stress/sphx_glr_02-volume_averaged_stress_001.png build/html/_images/ || true
187- cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_00*.png build/html/_images/ || true
188- cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_thumb.png build/html/_images/ || true
189-
190- # Verify the output
191- echo "Documentation build completed. Verifying contents..."
192- ls -R build/html
193-
194- # Display the log file content
195- echo "Displaying the log file content..."
196- cat "$LOG_FILE"
177+ ..\.venv\Scripts\activate.bat
178+ build_doc.bat > ..\doc\log.txt && type ..\doc\log.txt 2>&1
197179 timeout-minutes : 60
198180 env :
199181 MEILISEARCH_PUBLIC_API_KEY : ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
0 commit comments