Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
221 changes: 130 additions & 91 deletions .github/workflows/ci_cd_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,107 +136,146 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}

doc:
name: "Documentation build"
# doc:
# name: "Documentation build"
# runs-on: ubuntu-latest
# needs: [doc-style]
# steps:
# - name: "Checkout project"
# uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# with:
# persist-credentials: true

# - name: "Build documentation"
# uses: ./.github/actions/doc-build
# with:
# timeout-mins: 7200
# PyDynaRunContainer: ${{ env.PYDYNA_RUN_CONTAINER }}
# python-version: ${{ env.MAIN_PYTHON_VERSION }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# license-server: ${{ secrets.LICENSE_SERVER }}
# bot-token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
# github-actor: ${{ github.actor }}

doc-build-keywords:
name: Doc building For keyword documentation
runs-on: ubuntu-latest
needs: [doc-style]
needs: doc-style
steps:
- name: "Checkout project"
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Checkout project
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: true

- name: "Build documentation"
uses: ./.github/actions/doc-build
- name: Set up Python
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
with:
timeout-mins: 7200
PyDynaRunContainer: ${{ env.PYDYNA_RUN_CONTAINER }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
license-server: ${{ secrets.LICENSE_SERVER }}
bot-token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
github-actor: ${{ github.actor }}

smoke-tests:
name: "Build wheelhouse for ${{ matrix.os }} and Python ${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
needs: [code-style]
strategy:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: ansys/actions/build-wheelhouse@c2fa7c93f6883114e0e643599431b33d29f0b13f # v9.0.15

# - name: Install system dependencies
# run: |
# sudo apt-get update
# sudo apt-get install xvfb pandoc texlive-latex-extra latexmk
# shell: bash

- name: Install python dependencies
run: |
python -m pip install .[doc]
shell: bash

- name: Build keyword documentation
run: |
make -C doc html
shell: bash
env:
BUILD_EXAMPLES: 'false'

- name: Upload keyword documentation artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
library-name: ${{ env.PACKAGE_NAME }}
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
name: keyword-documentation
path: doc/_build/html/

# smoke-tests:
# name: "Build wheelhouse for ${{ matrix.os }} and Python ${{ matrix.python-version }}"
# runs-on: ${{ matrix.os }}
# needs: [code-style]
# strategy:
# fail-fast: false
# matrix:
# os: [windows-latest, ubuntu-latest]
# python-version: ['3.10', '3.11', '3.12', '3.13']
# steps:
# - uses: ansys/actions/build-wheelhouse@c2fa7c93f6883114e0e643599431b33d29f0b13f # v9.0.15
# with:
# library-name: ${{ env.PACKAGE_NAME }}
# operating-system: ${{ matrix.os }}
# python-version: ${{ matrix.python-version }}


keyword-testing:
name: "Keyword testing for matrix"
needs: [smoke-tests]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
# keyword-testing:
# name: "Keyword testing for matrix"
# needs: [smoke-tests]
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest, windows-latest]
# python-version: ['3.10', '3.11', '3.12', '3.13']
# steps:
# - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# with:
# persist-credentials: false

- name: Run test with "keywords" marker
uses: ./.github/actions/unit-test
with:
python-version: ${{ matrix.python-version }}
github-token: ${{ secrets.GITHUB_TOKEN }}
pytest-markers: keywords
coverage-file: keywords
# - name: Run test with "keywords" marker
# uses: ./.github/actions/unit-test
# with:
# python-version: ${{ matrix.python-version }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# pytest-markers: keywords
# coverage-file: keywords

run-testing:
name: Test the "run" subpackage
runs-on: ubuntu-latest
# needs: [smoke-tests]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
# run-testing:
# name: Test the "run" subpackage
# runs-on: ubuntu-latest
# # needs: [smoke-tests]
# steps:
# - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# with:
# persist-credentials: false

- uses: ./.github/actions/unit-test
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
docker-image: ${{ env.PYDYNA_RUN_CONTAINER }}
pytest-markers: run
license-server: ${{ secrets.LICENSE_SERVER }}
coverage-file: run

unit-tests:
name: "Testing"
runs-on: ubuntu-latest
needs: [keyword-testing, run-testing, codegen-testing]
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Run test without marker
uses: ./.github/actions/unit-test
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
github-token: ${{ secrets.GITHUB_TOKEN }}
server-logs: true
codecov-token: ${{ env.CODECOV_TOKEN }}
coverage-file: unittests

build-library:
name: "Build library"
needs: [doc, unit-tests]
runs-on: ubuntu-latest
steps:
- uses: ansys/actions/build-library@c2fa7c93f6883114e0e643599431b33d29f0b13f # v9.0.15
with:
library-name: ${{ env.PACKAGE_NAME }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
# - uses: ./.github/actions/unit-test
# with:
# python-version: ${{ env.MAIN_PYTHON_VERSION }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# docker-image: ${{ env.PYDYNA_RUN_CONTAINER }}
# pytest-markers: run
# license-server: ${{ secrets.LICENSE_SERVER }}
# coverage-file: run

# unit-tests:
# name: "Testing"
# runs-on: ubuntu-latest
# needs: [keyword-testing, run-testing, codegen-testing]
# steps:
# - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
# with:
# persist-credentials: false
# - name: Run test without marker
# uses: ./.github/actions/unit-test
# with:
# python-version: ${{ env.MAIN_PYTHON_VERSION }}
# github-token: ${{ secrets.GITHUB_TOKEN }}
# server-logs: true
# codecov-token: ${{ env.CODECOV_TOKEN }}
# coverage-file: unittests

# build-library:
# name: "Build library"
# needs: [doc, unit-tests]
# runs-on: ubuntu-latest
# steps:
# - uses: ansys/actions/build-library@c2fa7c93f6883114e0e643599431b33d29f0b13f # v9.0.15
# with:
# library-name: ${{ env.PACKAGE_NAME }}
# python-version: ${{ env.MAIN_PYTHON_VERSION }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,5 @@ cython_debug/
doc/source/examples/
doc/source/API/_autosummary/
doc/source/api
_build/
doc/source/keyword_classes_doc/api/
1 change: 1 addition & 0 deletions doc/changelog/930.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test api rst files
26 changes: 26 additions & 0 deletions doc/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
API reference
=============

This section describes PyDYNA's endpoints, their capabilities, and how
to interact with them programmatically.




.. jinja:: main_toctree

.. toctree::
:hidden:
:maxdepth: 3

{% if build_api %}
{% for page in pages %}
{% set length = autoapi_depth | int %}
{% if (page.top_level_object or page.name.split('.') | length == length) and page.display %}
<span class="nf nf-md-package"></span> {{ page.name }}<{{ page.include_path }}>
{% endif %}
{% endfor %}
<span class="nf nf-md-package"></span> Auto Keyword classes<../_autosummary/index>
{% endif %}


8 changes: 4 additions & 4 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "sphinx_boogergreen_theme_1", "Thumbs.db", ".DS_Store", "*.txt", "links.rst", "keyword_classes/**"]
exclude_patterns = ["_build", "sphinx_boogergreen_theme_1", "Thumbs.db", ".DS_Store", "*.txt", "links.rst", "keyword_classes/**", "keyword_classes_doc/**"]

# make rst_epilog a variable, so you can add other epilog parts to it
rst_epilog = ""
Expand Down Expand Up @@ -131,9 +131,9 @@
"collapse_navigation": True,
"use_edit_page_button": True,
"ansys_sphinx_theme_autoapi": {
"ignore": [
"*core/keywords/keyword_classes/auto*",
],
# "ignore": [
# "*core/keywords/keyword_classes/auto*",
# ],
"output": "api",
},
}
Expand Down
16 changes: 16 additions & 0 deletions doc/source/example.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Examples
========

This section provides examples of how to use PyDYNA in various scenarios.



.. jinja:: main_toctree

.. toctree::
:hidden:
:maxdepth: 3

{% if build_examples %}
examples/index
{% endif %}
8 changes: 2 additions & 6 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ PyDYNA documentation |version|

getting-started
user-guide/index
{% if build_api %}
api/index
{% endif %}
{% if build_examples %}
examples/index
{% endif %}
api.rst
examples.rst
contributing
changelog
30 changes: 30 additions & 0 deletions doc/source/keyword_classes_doc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS = -j auto
SPHINXBUILD = sphinx-build
SOURCEDIR =
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile clean pdf keyword_classes

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
do
clean:
rm -rf $(BUILDDIR)/*
rm -rf source/examples/gallery_examples
find . -type d -name $(APIDIR) -exec rm -rf {} +

pdf:
@$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true
(test -f $(BUILDDIR)/latex/*.pdf && echo pdf exists) || exit 1
Loading
Loading