-
Notifications
You must be signed in to change notification settings - Fork 25
204 lines (170 loc) · 5.78 KB
/
documentation.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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
name: SmuView Documentation
on:
push:
branches:
- master
paths:
- "manual/**"
- "src/python/bindings.cpp"
workflow_dispatch:
defaults:
run:
shell: bash
env:
# The path where the compiled packages will be installed.
INSTALL_DIR: "${{ github.workspace }}/sr"
# Git URL for the sigrok dependencies
SIGROK_REPO_BASE: "https://github.com/sigrokproject"
# Build type for SmuView (Debug, Release, RelWithDebInfo, MinSizeRel)
BUILD_TYPE: "Release"
# Misc commands
WGET: "wget -c --quiet"
GIT_CLONE: "git clone --depth=1"
jobs:
build_manual:
name: SmuView Manual
runs-on: ubuntu-latest
env:
BUILD_TYPE: "Release"
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
git-core gcc make autoconf automake libtool \
g++ autoconf-archive pkg-config libglib2.0-dev libglibmm-2.4-dev \
libzip-dev check doxygen swig \
cmake libboost-dev libqt5svg5-dev qtbase5-dev libqwt-qt5-dev \
python3-dev python-gi-dev python-setuptools \
asciidoctor ruby-asciidoctor-pdf coderay
- name: Checkout sigrok-utils
uses: actions/checkout@v3
with:
repository: knarfS/sigrok-util
path: sigrok-util
ref: github
- name: Build dependencies
run: |
cd sigrok-util/cross-compile/github-actions
source sigrok-linux-init-toolchain.sh
./sigrok-linux-build-dependencies.sh
- name: Checkout smuview
uses: actions/checkout@v3
with:
path: smuview
- name: Build manual
run: |
source sigrok-util/cross-compile/github-actions/sigrok-linux-init-toolchain.sh
mkdir -p smuview/build
cd smuview/build
PKG_CONFIG_PATH=$P cmake \
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_DIR \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DDISABLE_WERROR=TRUE \
-DENABLE_TESTS=FALSE \
..
make manual $V
make manual-publish $V
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: SmuView_manual
path: smuview/build/manual_publish/
build_python_doc:
name: SmuView Python API
runs-on: ubuntu-latest
env:
BUILD_TYPE: "Release"
steps:
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
git-core gcc make autoconf automake libtool \
g++ autoconf-archive pkg-config libglib2.0-dev libglibmm-2.4-dev \
libzip-dev check doxygen swig \
cmake libboost-dev libqt5svg5-dev qtbase5-dev libqwt-qt5-dev \
python3-dev python-gi-dev python-setuptools coreutils
- name: Checkout sigrok-utils
uses: actions/checkout@v3
with:
repository: knarfS/sigrok-util
path: sigrok-util
ref: github
- name: Build dependencies
run: |
cd sigrok-util/cross-compile/github-actions
source sigrok-linux-init-toolchain.sh
./sigrok-linux-build-dependencies.sh
- name: Checkout smuview
uses: actions/checkout@v3
with:
path: smuview
- name: Build smuview
run: |
source sigrok-util/cross-compile/github-actions/sigrok-linux-init-toolchain.sh
mkdir -p smuview/build
cd smuview/build
PKG_CONFIG_PATH=$P cmake \
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_DIR \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
-DDISABLE_WERROR=y \
-DENABLE_TESTS=FALSE \
..
make $PARALLEL $V
make install $V
- name: Build API doc
run: |
pip3 install pdoc3
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"$INSTALL_DIR/lib"
# Source versions and create destination folders
source smuview/build/contrib/config_version.sh
mkdir -p api_doc/"$SV_MANUAL_VERSION"
# Create script for generating the API doc
cat > gen_api.py << EOF
import smuview
import pdoc
html_str = pdoc.html("smuview", show_type_annotations=True)
f = open('./api_doc/$SV_MANUAL_VERSION/python_bindings_api.html', 'w')
print(html_str, file=f)
f.close()
EOF
# Generating the API doc
timeout --preserve-status 60 $INSTALL_DIR/bin/smuview -s gen_api.py -platform offscreen
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: SmuView_Python_API
path: api_doc/
publish:
name: SmuView documentation publish
runs-on: ubuntu-latest
needs:
- build_manual
- build_python_doc
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Inspect directory after downloading artifacts
run: ls -alFR
- name: Checkout knarfS.github.io
uses: actions/checkout@v3
with:
repository: knarfS/knarfS.github.io
path: knarfS.github.io
persist-credentials: false
- name: Copy documentation
run: |
cp -r SmuView_manual/* knarfS.github.io/doc/smuview
cp -r SmuView_Python_API/* knarfS.github.io/doc/smuview
- name: Publish documentation
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
with:
source-directory: "knarfS.github.io"
destination-github-username: "knarfS"
destination-repository-name: "knarfS.github.io"
user-email: "frank-stettner@gmx.net"
target-branch: "master"
commit-message: "Automated update for ORIGIN_COMMIT"