Skip to content

Commit

Permalink
pdoc action
Browse files Browse the repository at this point in the history
  • Loading branch information
tschm committed Jan 7, 2024
1 parent f2db63a commit f8d4893
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/test_pdoc.yml
Original file line number Diff line number Diff line change
@@ -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
46 changes: 46 additions & 0 deletions actions/pdoc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Empty file added cvx/dog/__init__.py
Empty file.
20 changes: 20 additions & 0 deletions cvx/dog/demo.py
Original file line number Diff line number Diff line change
@@ -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*"""

0 comments on commit f8d4893

Please sign in to comment.