diff --git a/.github/workflows/test_pdoc.yml b/.github/workflows/test_pdoc.yml new file mode 100644 index 0000000..4ccb703 --- /dev/null +++ b/.github/workflows/test_pdoc.yml @@ -0,0 +1,20 @@ +name: Build pdoc documentation + +on: + [push] + +jobs: + build_paper: + runs-on: ubuntu-latest + + steps: + - name: Set up Git repository + uses: actions/checkout@v3 + + - uses: ./actions/pdoc + with: + source-folder: "cvx" + + #paper: tests/tex/*.tex + #GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + #output-folder: /tests/texgroup diff --git a/actions/pdoc/action.yml b/actions/pdoc/action.yml index 70efebf..531e09a 100644 --- a/actions/pdoc/action.yml +++ b/actions/pdoc/action.yml @@ -11,3 +11,49 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +name: Build pdoc documentation + +description: "Build pdoc documentation" + +on: + workflow_call: + inputs: + python-version: + description: 'Python version' + type: string + required: false + default: '3.10' + source-folder: + description: 'Source folder' + type: string + required: false + default: 'cvx' + pdoc-arguments: + description: 'pdoc arguments' + type: string + required: false + default: '' +runs: + using: "composite" + + steps: + - uses: cvxgrp/.github/actions/setup-environment@main + with: + python-version: ${{ inputs.python-version || '3.10' }} + + - name: Install pdoc + shell: bash + run: | + poetry run pip install --no-cache-dir pdoc==14.3.0 + + - name: Build pdoc + shell: bash + run: | + poetry run pdoc -o artifacts/pdoc ${{ inputs.pdoc-arguments || '' }} ${{ inputs.source-folder || 'cvx' }} + + - name: Archive sphinx documentation + uses: actions/upload-artifact@v3 + with: + name: pdoc + path: artifacts/pdoc + retention-days: 1 diff --git a/cvx/dog/__init__.py b/cvx/dog/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/cvx/dog/demo.py b/cvx/dog/demo.py new file mode 100644 index 0000000..0d84a55 --- /dev/null +++ b/cvx/dog/demo.py @@ -0,0 +1,20 @@ +""" +A small `pdoc` example. +""" + + +class Dog: + """🐕""" + + name: str + """The name of our dog.""" + friends: list["Dog"] + """The friends of our dog.""" + + def __init__(self, name: str): + """Make a Dog without any friends (yet).""" + self.name = name + self.friends = [] + + def bark(self, loud: bool = True): + """*woof*"""