-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (113 loc) · 4.46 KB
/
autodoc_cicd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Autogenerated library CI
on:
workflow_dispatch:
schedule: # UTC at 0300
- cron: "0 3 * * *"
pull_request:
push:
tags:
- "*"
branches:
- main
env:
RESET_PIP_CACHE_2: 1
RESET_AUTOSUMMARY_CACHE_2: 1
RESET_DOC_BUILD_CACHE_2: 1
jobs:
generate-code:
name: "Building repository - autodoc"
runs-on: ubuntu-latest
steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4
- name: "Setup Python"
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.MAIN_PYTHON_VERSION }}
- name: "Cache pip"
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: Python-pyconverter-generatedcommands-v${{ env.RESET_PIP_CACHE_2 }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
Python-pyconverter-generatedcommands-v${{ env.RESET_PIP_CACHE_2 }}
# The token will expire in 2024.
- name: "Checkout mapdl-cmd-doc repository"
uses: actions/checkout@v4
with:
repository: ansys-internal/mapdl-cmd-doc
ref: feat/pyconverter-xml2py-predifined-format
token: ${{ secrets.MAPDL_CMD_DOC_TOKEN }}
path: mapdl-cmd-doc
- name: "Install pyconverter-xml2py"
run: |
pip install --upgrade pip
pip install .[tests]
- name: "Create pyconverter-autogenerated package"
run: |
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
with:
name: package
path: ./package
auto-doc-code-style:
name: "Code style - autodoc"
runs-on: ubuntu-latest
needs: [generate-code]
steps:
- name: Download autogenerated documentation
uses: actions/download-artifact@v4
with:
name: package
- name: Test download artifacts
run: ls -R -a
- name: PyAnsys code style checks
uses: ansys/actions/code-style@v8
with:
python-version: ${{ inputs.MAIN_PYTHON_VERSION }}
use-python-cache: false
auto-doc-build:
name: "Building documentation - autodoc"
runs-on: ubuntu-latest
needs: [auto-doc-code-style]
steps:
- name: Download autogenerated documentation
uses: actions/download-artifact@v4
with:
name: package
- name: "Cache pip"
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: Python-pyconverter-generatedcommands-v${{ env.RESET_PIP_CACHE_2 }}-${{ inputs.MAIN_PYTHON_VERSION }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
Python-pyconverter-generatedcommands-v${{ env.RESET_PIP_CACHE_2 }}-${{ inputs.MAIN_PYTHON_VERSION }}
- name: "Install pyconverter-generatedcommands"
run: |
pip install .
- name: "Retrieve PyConverter-GeneratedCommands version"
run: |
echo "PYCONVERTER_GENERATED_VERSION=$(python -c 'from pyconverter.generatedcommands import __version__; print(__version__)')" >> $GITHUB_ENV
echo "PyConverter-GeneratedCommands version is: $(python -c 'from pyconverter.generatedcommands import __version__; print(__version__)')"
- name: "Cache docs build directory"
uses: actions/cache@v4
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
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@v8
with:
python-version: ${{ inputs.MAIN_PYTHON_VERSION }}
checkout: false
sphinxopts: -j auto
check-links: false