Skip to content

Commit

Permalink
fix: check if modifying action file fixes doc-build error
Browse files Browse the repository at this point in the history
  • Loading branch information
moe-ad committed Dec 14, 2024
1 parent c0bdb08 commit f23c959
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 5 deletions.
53 changes: 50 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,57 @@ jobs:
run: pip list

- name: "Build HTML Documentation"
shell: cmd /D /E:ON /V:OFF /C "CALL "{0}""
working-directory: .ci
shell: bash
run: |
build_doc.bat > ..\doc\log.txt && type ..\doc\log.txt 2>&1
# Navigate to the documentation directory
cd doc
# Create a log file for output redirection
LOG_FILE="../doc/log.txt"
exec > >(tee -a "$LOG_FILE") 2>&1
echo "Starting documentation build process..."
# Backup files from source/examples and source/_temp/plugins before cleaning
echo "Backing up files before cleaning..."
mkdir -p source/_backup
[ -d "source/examples/07-python-operators/plugins" ] && cp -r source/examples/07-python-operators/plugins source/_backup/plugins || true
[ -d "source/examples/04-advanced/02-volume_averaged_stress" ] && cp -r source/examples/04-advanced/02-volume_averaged_stress source/_backup/04_advanced || true
[ -d "source/examples/12-fluids/02-fluids_results" ] && cp -r source/examples/12-fluids/02-fluids_results source/_backup/12_fluids || true
# Clean previous builds
echo "Cleaning previous build artifacts..."
rm -rf build source/images/auto-generated source/examples
rm -rf source/_temp || true
# Restore backed-up files
echo "Restoring backed-up files..."
mkdir -p source/examples/07-python-operators
[ -d "source/_backup/plugins" ] && cp -r source/_backup/plugins source/examples/07-python-operators/plugins || true
mkdir -p source/examples/04-advanced
[ -d "source/_backup/04_advanced" ] && cp -r source/_backup/04_advanced source/examples/04-advanced/02-volume_averaged_stress || true
mkdir -p source/examples/12-fluids
[ -d "source/_backup/12_fluids" ] && cp -r source/_backup/12_fluids source/examples/12-fluids/02-fluids_results || true
rm -rf source/_backup || true
# Build the HTML documentation
echo "Building HTML documentation..."
sphinx-build -b html source build/html -v
# Copy necessary images to the build directory
echo "Copying images for patching pyVista issues..."
mkdir -p build/html/_images
cp -v source/examples/04-advanced/02-volume_averaged_stress/sphx_glr_02-volume_averaged_stress_001.png build/html/_images/ || true
cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_00*.png build/html/_images/ || true
cp -v source/examples/12-fluids/02-fluids_results/sphx_glr_02-fluids_results_thumb.png build/html/_images/ || true
# Verify the output
echo "Documentation build completed. Verifying contents..."
ls -R build/html
# Display the log file content
echo "Displaying the log file content..."
cat "$LOG_FILE"
timeout-minutes: 60
env:
MEILISEARCH_PUBLIC_API_KEY: ${{ secrets.MEILISEARCH_PUBLIC_API_KEY }}
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/dpf/core/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@ def find_ansys():
if base_path is None:
return base_path

paths = base_path.glob("v*")
paths = list(base_path.glob("v*"))

Check warning on line 186 in src/ansys/dpf/core/misc.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/dpf/core/misc.py#L186

Added line #L186 was not covered by tests

if not list(paths):
if not paths:

Check warning on line 188 in src/ansys/dpf/core/misc.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/dpf/core/misc.py#L188

Added line #L188 was not covered by tests
return None

versions = {}
Expand Down

0 comments on commit f23c959

Please sign in to comment.