-
Notifications
You must be signed in to change notification settings - Fork 25
57 lines (49 loc) · 1.82 KB
/
pyfiction-docstring-generator.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
name: 🐍 • Docstring Generator
on:
push:
paths:
- '**/*.hpp'
- '.github/workflows/pyfiction-docstring-generator.yml'
workflow_dispatch:
jobs:
get_docstrings:
name: 🐍 Auto-generate docstrings for pyfiction from C++ code
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13.x"
cache: 'pip'
- name: Install pybind11_mkdoc and clang
working-directory: ${{ github.workspace }}
run: pip install pybind11_mkdoc clang==15.0.7
- name: Create docstrings file
working-directory: ${{ github.workspace }}
run: touch ${{ github.workspace }}/pybind11_mkdoc_docstrings.hpp
- name: Run pybind11_mkdoc
working-directory: ${{ github.workspace }}
run: >
python3
-m pybind11_mkdoc
-o ${{ github.workspace }}/bindings/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp
-D FICTION_Z3_SOLVER
`find ${{ github.workspace }}/include/fiction -name "*.hpp" -print`
- name: Upload docstrings as an artifact
uses: actions/upload-artifact@v4
with:
path: ${{ github.workspace }}/bindings/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp
overwrite: true
- name: Commit docstrings
uses: EndBug/add-and-commit@v9
with:
add: 'bindings/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp'
commit: '--signoff'
message: ':memo: Update pyfiction docstrings'
author_name: GitHub Actions
author_email: actions@github.com