Skip to content

Commit

Permalink
Merge branch 'refs/heads/main' into release/0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
gmalinve committed Oct 7, 2024
2 parents c33a556 + 3af0e49 commit 3575ed1
Show file tree
Hide file tree
Showing 288 changed files with 17,114 additions and 28,293 deletions.
118 changes: 17 additions & 101 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: GitHub CI CD
on:
pull_request:
# GitHub default types + ready_for_review to trigger the workflow on PRs no longer in draft mode.
# See https://github.com/ansys/pyaedt/issues/5223 for more information
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
push:
tags:
Expand Down Expand Up @@ -70,7 +73,7 @@ jobs:
# TODO: Update to ansys/actions/doc-build@v6 once we remove examples
doc-build:
name: Documentation build without examples
name: Documentation build
runs-on: ubuntu-latest
needs: [doc-style]
steps:
Expand All @@ -88,7 +91,7 @@ jobs:
- name: Install pyaedt and documentation dependencies
run: |
pip install .[doc-no-examples]
pip install .[doc]
- name: Retrieve PyAEDT version
id: version
Expand All @@ -102,119 +105,28 @@ jobs:
sudo apt install graphviz texlive-latex-extra latexmk texlive-xetex texlive-fonts-extra -y
# TODO: Update this step once pyaedt-examples is ready
- name: Build HTML documentation without examples
- name: Build HTML documentation
run: |
make -C doc clean
make -C doc html-no-examples
make -C doc html
# Verify that sphinx generates no warnings
- name: Check for warnings
run: |
python doc/print_errors.py
- name: Upload HTML documentation without examples artifact
- name: Upload HTML documentation without artifact
uses: actions/upload-artifact@v3
with:
name: documentation-no-examples-html
name: documentation-html
path: doc/_build/html
retention-days: 7

- name: Build PDF documentation without examples
- name: Build PDF documentation
run: |
make -C doc pdf-no-examples
- name: Upload PDF documentation without examples artifact
uses: actions/upload-artifact@v3
with:
name: documentation-no-examples-pdf
path: doc/_build/latex/PyAEDT-Documentation-*.pdf
retention-days: 7

# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
# # =================================================================================================

doc-build-with-examples:
name: Documentation build with examples
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: [ self-hosted, Windows, pyaedt ]
needs: [doc-style]
timeout-minutes: 720
steps:
- name: Install Git and checkout project
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: Create virtual environment
run: |
python -m venv .venv
.venv\Scripts\Activate.ps1
python -m pip install pip -U
python -m pip install wheel setuptools -U
python -c "import sys; print(sys.executable)"
- name: Install pyaedt and documentation dependencies
run: |
.venv\Scripts\Activate.ps1
pip install .[doc]
- name: Retrieve PyAEDT version
id: version
run: |
.venv\Scripts\Activate.ps1
echo "PYAEDT_VERSION=$(python -c 'from ansys.aedt.core import __version__; print(__version__)')" >> $GITHUB_OUTPUT
echo "PyAEDT version is: $(python -c "from ansys.aedt.core import __version__; print(__version__)")"
- name: Install CI dependencies (e.g. vtk-osmesa)
run: |
.venv\Scripts\Activate.ps1
# Uninstall conflicting dependencies
pip uninstall --yes vtk
pip install --extra-index-url https://wheels.vtk.org vtk-osmesa
# TODO: Update this step once pyaedt-examples is ready
# NOTE: Use environment variable to keep the doctree and avoid redundant build for PDF pages
- name: Build HTML documentation with examples
env:
SPHINXBUILD_KEEP_DOCTREEDIR: "1"
run: |
.venv\Scripts\Activate.ps1
.\doc\make.bat clean
.\doc\make.bat html
# TODO: Keeping this commented as reminder of https://github.com/ansys/pyaedt/issues/4296
# # Verify that sphinx generates no warnings
# - name: Check for warnings
# run: |
# .venv\Scripts\Activate.ps1
# python doc/print_errors.py

# Use environment variable to remove the doctree after the build of PDF pages
- name: Build PDF documentation with examples
env:
SPHINXBUILD_KEEP_DOCTREEDIR: "0"
run: |
.venv\Scripts\Activate.ps1
.\doc\make.bat pdf
# - name: Add assets to HTML docs
# run: |
# zip -r documentation-html.zip ./doc/_build/html
# mv documentation-html.zip ./doc/_build/html/_static/assets/download/
# cp doc/_build/latex/PyAEDT-Documentation-*.pdf ./doc/_build/html/_static/assets/download/pyaedt.pdf

- name: Upload HTML documentation with examples artifact
uses: actions/upload-artifact@v3
with:
name: documentation-html
path: doc/_build/html
retention-days: 7
make -C doc pdf
- name: Upload PDF documentation without examples artifact
- name: Upload PDF documentation
uses: actions/upload-artifact@v3
with:
name: documentation-pdf
Expand All @@ -227,6 +139,7 @@ jobs:

test-solvers-windows:
name: Testing solvers and coverage (Windows)
if: github.event.pull_request.draft == false
needs: [smoke-tests]
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
Expand Down Expand Up @@ -287,6 +200,7 @@ jobs:
# TODO: Si if we can use ansys/actions
test-solvers-linux:
name: Testing solvers and coverage (Linux)
if: github.event.pull_request.draft == false
needs: [smoke-tests]
runs-on: [ self-hosted, Linux, pyaedt ]
env:
Expand Down Expand Up @@ -343,6 +257,7 @@ jobs:

test-windows:
name: Testing and coverage (Windows)
if: github.event.pull_request.draft == false
needs: [smoke-tests]
runs-on: [ self-hosted, Windows, pyaedt ]
steps:
Expand Down Expand Up @@ -408,6 +323,7 @@ jobs:
# TODO: Si if we can use ansys/actions
test-linux:
name: Testing and coverage (Linux)
if: github.event.pull_request.draft == false
needs: [smoke-tests]
runs-on: [ self-hosted, Linux, pyaedt ]
env:
Expand Down Expand Up @@ -485,7 +401,7 @@ jobs:
release:
name: Release project
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [package, doc-build-with-examples]
needs: [package, doc-build]
runs-on: ubuntu-latest
steps:
- name: Release to the public PyPI repository
Expand Down
Loading

0 comments on commit 3575ed1

Please sign in to comment.