From 19aba5c439883ae8b034314844ef003415b29a54 Mon Sep 17 00:00:00 2001 From: Sebastien Morais Date: Mon, 21 Oct 2024 09:25:22 +0200 Subject: [PATCH] CI: Bump ansys actions version --- .github/workflows/ci_cd.yml | 106 +++-------------------------- .github/workflows/nightly-docs.yml | 101 ++------------------------- doc/source/conf.py | 24 +------ 3 files changed, 20 insertions(+), 211 deletions(-) diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index b089a550e06..9735fc9f3bf 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check commit name - uses: ansys/actions/commit-style@v6 + uses: ansys/actions/commit-style@v8 with: token: ${{ secrets.GITHUB_TOKEN }} use-upper-case: true @@ -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 }} @@ -71,67 +70,15 @@ 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: 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 + dependencies: 'graphviz texlive-latex-extra latexmk texlive-xetex texlive-fonts-extra' # # ================================================================================================= # # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv RUNNING ON SELF-HOSTED RUNNER vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv @@ -392,7 +339,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 }} @@ -405,14 +352,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 }} @@ -423,40 +370,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 }} diff --git a/.github/workflows/nightly-docs.yml b/.github/workflows/nightly-docs.yml index edd24011d09..d5b1a7c8c5d 100644 --- a/.github/workflows/nightly-docs.yml +++ b/.github/workflows/nightly-docs.yml @@ -22,110 +22,21 @@ jobs: doc-build: name: Documentation build runs-on: [ self-hosted, Windows, pyaedt ] - timeout-minutes: 720 - steps: - - name: Install Git and checkout project - uses: actions/checkout@v4 - - - name: Setup Python - uses: actions/setup-python@v5 + needs: [doc-style] + - 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 }} diff --git a/doc/source/conf.py b/doc/source/conf.py index ba352a4086c..6a4e7c92bbc 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -318,29 +318,11 @@ def setup(app): 'custom.css', ] - -# -- Options for HTMLHelp output --------------------------------------------- - -# Output file base name for HTML help builder. -htmlhelp_basename = "pyaedtdoc" - # -- Options for LaTeX output ------------------------------------------------ -# additional logos for the latex coverpage + +# Additional logos for the latex coverpage latex_additional_files = [watermark, ansys_logo_white, ansys_logo_white_cropped] -# change the preamble of latex with customized title page +# Change the preamble of latex with customized title page # variables are the title of pdf, watermark latex_elements = {"preamble": latex.generate_preamble(html_title)} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - f"{project}-Documentation-{__version__}.tex", - f"{project} Documentation", - author, - "manual", - ), -]