Skip to content

Commit

Permalink
Merge branch 'main' into release/0.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuelopez-ansys committed Oct 22, 2024
2 parents 7a79071 + 6853d05 commit 5e61e72
Show file tree
Hide file tree
Showing 16 changed files with 1,764 additions and 488 deletions.
107 changes: 13 additions & 94 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check commit name
uses: ansys/actions/commit-style@v6
uses: ansys/actions/check-pr-title@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
use-upper-case: true
Expand All @@ -57,10 +57,9 @@ jobs:
os: [ubuntu-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
target: ['all', 'installer']

steps:
- name: Build wheelhouse and perform smoke test
uses: ansys/actions/build-wheelhouse@v4
uses: ansys/actions/build-wheelhouse@v8
with:
library-name: ${{ env.PACKAGE_NAME }}
operating-system: ${{ matrix.os }}
Expand All @@ -71,67 +70,18 @@ jobs:
run: |
python -c "import ansys.aedt.core; from ansys.aedt.core import __version__"
# TODO: Update to ansys/actions/doc-build@v6 once we remove examples
doc-build:
name: Documentation build
runs-on: ubuntu-latest
needs: [doc-style]
steps:
- name: Install Git and checkout project
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
- name: Documentation build
uses: ansys/actions/doc-build@v8
with:
dependencies: "graphviz texlive-latex-extra latexmk texlive-xetex texlive-fonts-extra"
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: Update pip
run: |
pip install --upgrade pip
- name: Install pyaedt and documentation dependencies
run: |
pip install .[doc]
- name: Retrieve PyAEDT version
id: version
run: |
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 doc build requirements
run: |
sudo apt update
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
run: |
make -C doc clean
make -C doc html
# Verify that sphinx generates no warnings
- name: Check for warnings
run: |
python doc/print_errors.py
- name: Upload HTML documentation
uses: actions/upload-artifact@v4
with:
name: documentation-html
path: doc/_build/html
retention-days: 7

- name: Build PDF documentation
run: |
make -C doc pdf
- name: Upload PDF documentation
uses: actions/upload-artifact@v4
with:
name: documentation-pdf
path: doc/_build/latex/PyAEDT-Documentation-*.pdf
retention-days: 7
sphinxopts: '-j auto --color -w build_errors.txt'
check-links: false

# # =================================================================================================
# # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Expand Down Expand Up @@ -392,7 +342,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Build library source and wheel artifacts
uses: ansys/actions/build-library@v4
uses: ansys/actions/build-library@v8
with:
library-name: ${{ env.PACKAGE_NAME }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
Expand All @@ -405,14 +355,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Release to the public PyPI repository
uses: ansys/actions/release-pypi-public@v4
uses: ansys/actions/release-pypi-public@v8
with:
library-name: ${{ env.PACKAGE_NAME }}
twine-username: "__token__"
twine-token: ${{ secrets.PYPI_TOKEN }}

- name: Release to GitHub
uses: ansys/actions/release-github@v4
uses: ansys/actions/release-github@v8
with:
library-name: ${{ env.PACKAGE_NAME }}

Expand All @@ -423,40 +373,9 @@ jobs:
needs: [release]
steps:
- name: Deploy the stable documentation
uses: ansys/actions/doc-deploy-stable@v5
uses: ansys/actions/doc-deploy-stable@v8
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: 'documentation-html'

doc-index-stable:
name: Deploy stable docs index
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: upload-release-doc
steps:
- name: Install Git and clone project
uses: actions/checkout@v4

- name: Install the package requirements
run: |
python -m pip install --upgrade pip
pip install -e .
- name: Get the version to PyMeilisearch
run: |
VERSION=$(python -c "from ansys.aedt.core import __version__; print('.'.join(__version__.split('.')[:2]))")
VERSION_MEILI=$(python -c "from ansys.aedt.core import __version__; print('-'.join(__version__.split('.')[:2]))")
echo "Calculated VERSION: $VERSION"
echo "Calculated VERSION_MEILI: $VERSION_MEILI"
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "VERSION_MEILI=$VERSION_MEILI" >> $GITHUB_ENV
- name: Deploy the latest documentation index
uses: ansys/actions/doc-deploy-index@v5
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/${{ env.VERSION }}
index-name: pyaedt-v${{ env.VERSION_MEILI }}
host-url: ${{ env.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
100 changes: 6 additions & 94 deletions .github/workflows/nightly-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,110 +22,22 @@ jobs:
doc-build:
name: Documentation build
runs-on: [ self-hosted, Windows, pyaedt ]
timeout-minutes: 720
needs: [doc-style]
steps:
- name: Install Git and checkout project
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
- name: Documentation build
uses: ansys/actions/doc-build@v8
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==9.2.20230527.dev0
# 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@v4
with:
name: documentation-html
path: doc/_build/html
retention-days: 7

- name: Upload PDF documentation without examples artifact
uses: actions/upload-artifact@v4
with:
name: documentation-pdf
path: doc/_build/latex/PyAEDT-Documentation-*.pdf
retention-days: 7

upload-dev-doc:
name: Upload dev documentation
runs-on: ubuntu-latest
needs: doc-build
steps:
- name: Upload development documentation
uses: ansys/actions/doc-deploy-dev@v5
uses: ansys/actions/doc-deploy-dev@v8
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
doc-artifact-name: 'documentation-html'

doc-index-dev:
name: Deploy dev index docs
runs-on: ubuntu-latest
needs: upload-dev-doc
steps:
- name: Deploy the latest documentation index
uses: ansys/actions/doc-deploy-index@v5
with:
cname: ${{ env.DOCUMENTATION_CNAME }}/version/dev
index-name: pyaedt-vdev
host-url: ${{ env.MEILISEARCH_HOST_URL }}
api-key: ${{ env.MEILISEARCH_API_KEY }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }}
bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }}
9 changes: 9 additions & 0 deletions _unittest/test_12_1_PostProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ def test_09_manipulate_report(self):
assert self.aedtapp.post.create_report_from_configuration(
os.path.join(self.local_scratch.path, f"{plot.plot_name}.json"), solution_name=self.aedtapp.nominal_sweep
)
assert self.aedtapp.post.create_report_from_configuration(
os.path.join(self.local_scratch.path, f"{plot.plot_name}.json"),
solution_name=self.aedtapp.nominal_sweep,
matplotlib=True,
)
assert self.aedtapp.post.create_report(
expressions="MaxMagDeltaS",
variations={"Pass": ["All"]},
Expand Down Expand Up @@ -760,6 +765,7 @@ def test_67_sweep_from_json(self):
local_path = os.path.dirname(os.path.realpath(__file__))
dict_vals = read_json(os.path.join(local_path, "example_models", "report_json", "Modal_Report_Simple.json"))
assert self.aedtapp.post.create_report_from_configuration(report_settings=dict_vals)
assert self.aedtapp.post.create_report_from_configuration(report_settings=dict_vals, matplotlib=True)

@pytest.mark.skipif(
config["desktopVersion"] < "2022.2", reason="Not working in non graphical in version lower than 2022.2"
Expand All @@ -769,6 +775,9 @@ def test_70_sweep_from_json(self):
assert self.aedtapp.post.create_report_from_configuration(
os.path.join(local_path, "example_models", "report_json", "Modal_Report.json")
)
assert self.aedtapp.post.create_report_from_configuration(
os.path.join(local_path, "example_models", "report_json", "Modal_Report.json"), matplotlib=True
)

def test_74_dynamic_update(self):
val = self.aedtapp.post.update_report_dynamically
Expand Down
Loading

0 comments on commit 5e61e72

Please sign in to comment.