Skip to content
Open
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
31 changes: 17 additions & 14 deletions .github/workflows/autodoc_cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,31 @@ on:
branches:
- main


env:
RESET_PIP_CACHE_2: 1
RESET_AUTOSUMMARY_CACHE_2: 1
RESET_DOC_BUILD_CACHE_2: 1
MAIN_PYTHON_VERSION: '3.12'

permissions: {}

jobs:
generate-code:
name: "Building repository - autodoc"
runs-on: ubuntu-latest
steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

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

- name: "Cache pip"
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 # zizmor: ignore[cache-poisoning]
with:
path: ~/.cache/pip
key: Python-pyconverter-generatedcommands-v${{ env.RESET_PIP_CACHE_2 }}-${{ hashFiles('pyproject.toml') }}
Expand All @@ -42,12 +44,13 @@ jobs:

# The token will expire in 2024.
- name: "Checkout mapdl-cmd-doc repository"
uses: actions/checkout@v4
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: ansys-internal/mapdl-cmd-doc
ref: feat/pyconverter-xml2py-predifined-format
token: ${{ secrets.MAPDL_CMD_DOC_TOKEN }}
path: mapdl-cmd-doc
persist-credentials: false

- name: "Install pyconverter-xml2py"
run: |
Expand All @@ -56,10 +59,10 @@ jobs:

- name: "Create pyconverter-autogenerated package"
run: |
pyconverter-xml2py package -x ${{ github.workspace }}/mapdl-cmd-doc -f ${{ github.workspace }}/tests/customized_functions -l 100
pyconverter-xml2py package -x ${GITHUB_WORKSPACE}/mapdl-cmd-doc -f ${GITHUB_WORKSPACE}/tests/customized_functions -l 100

- name: Upload autogenerated doc artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: package
path: ./package
Expand All @@ -71,15 +74,15 @@ jobs:
needs: [generate-code]
steps:
- name: Download autogenerated documentation
uses: actions/download-artifact@v4
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
name: package

- name: Test download artifacts
run: ls -R -a

- name: PyAnsys code style checks
uses: ansys/actions/code-style@v10
uses: ansys/actions/code-style@1096998b81f7ebdea116b683e11f3a8bda759ca6 # v10.0.14
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
use-python-cache: false
Expand All @@ -91,12 +94,12 @@ jobs:
needs: [auto-doc-code-style]
steps:
- name: Download autogenerated documentation
uses: actions/download-artifact@v4
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
with:
name: package

- name: "Cache pip"
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 # zizmor: ignore[cache-poisoning]
with:
path: ~/.cache/pip
key: Python-pyconverter-generatedcommands-v${{ env.RESET_PIP_CACHE_2 }}-${{ env.MAIN_PYTHON_VERSION }}-${{ hashFiles('pyproject.toml') }}
Expand All @@ -113,23 +116,23 @@ jobs:
echo "PyConverter-GeneratedCommands version is: $(python -c 'from pyconverter.generatedcommands import __version__; print(__version__)')"

- name: "Cache docs build directory"
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 # zizmor: ignore[cache-poisoning]
with:
path: doc/_build
key: doc-build-pyconverter-generatedcommands-v${{ env.RESET_DOC_BUILD_CACHE_2 }}-${{ inputs.PYCONVERTER_GENERATED_VERSION }}-${{ github.sha }}
restore-keys: |
doc-build-pyconverter-generatedcommands-v${{ env.RESET_DOC_BUILD_CACHE_2 }}-${{ inputs.PYCONVERTER_GENERATED_VERSION }}

- name: "Cache autosummary"
uses: actions/cache@v4
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3 # zizmor: ignore[cache-poisoning]
with:
path: doc/source/_autosummary/*.rst
key: autosummary-pyconverter-generatedcommands-v${{ env.RESET_AUTOSUMMARY_CACHE_2 }}-${{ inputs.PYCONVERTER_GENERATED_VERSION }}-${{ github.sha }}
restore-keys: |
autosummary-pyconverter-generatedcommands-v${{ env.RESET_AUTOSUMMARY_CACHE_2 }}-${{ inputs.PYCONVERTER_GENERATED_VERSION }}

- name: "Run Ansys documentation building action"
uses: ansys/actions/doc-build@v10
uses: ansys/actions/doc-build@1096998b81f7ebdea116b683e11f3a8bda759ca6 # v10.0.14
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
checkout: false
Expand Down
Loading