Skip to content

Commit 20351e9

Browse files
committed
Merge branch 'dev'
2 parents ab4ed79 + 52ecaa9 commit 20351e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+3067
-354
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.sh text eol=lf

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* @JimLewis
2+
3+
/.github/ @Paebbels

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
# Maintain GitHub Action runners
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
target-branch: dev
7+
commit-message:
8+
prefix: "[Dependabot]"
9+
labels:
10+
- Dependencies
11+
assignees:
12+
- Paebbels
13+
schedule:
14+
interval: "daily" # Checks on Monday trough Friday.

.github/pull_request_template.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# New Features
2+
3+
* tbd
4+
* tbd
5+
6+
# Changes
7+
8+
* tbd
9+
* tbd
10+
11+
# Bug Fixes
12+
13+
* tbd
14+
* tbd
15+
16+
# Documentation
17+
18+
* tbd
19+
* tbd
20+
21+
# Tests
22+
23+
* tbd
24+
* tbd
25+
26+
----------
27+
# Related Issues and Pull-Requests
28+
29+
* tbd
30+
* tbd

.github/workflows/Pipeline.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Pipeline
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
schedule:
7+
# Every Friday at 22:00 - rerun pipeline to check for dependency-based issues
8+
- cron: '0 22 * * 5'
9+
10+
permissions:
11+
actions: write
12+
contents: write
13+
pages: write
14+
id-token: write
15+
16+
jobs:
17+
18+
Documentation:
19+
uses: ./.github/workflows/SphinxDocumentation.yml
20+
with:
21+
html_artifact: doc_html
22+
latex_artifact: doc_latex
23+
24+
PDFDocumentation:
25+
uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@r7
26+
needs:
27+
- Documentation
28+
with:
29+
document: "OSVVMScripts"
30+
latex_artifact: doc_latex
31+
pdf_artifact: doc_pdf
32+
can-fail: 'true'
33+
34+
PublishToGitHubPages:
35+
uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@r7
36+
needs:
37+
- Documentation
38+
# - PDFDocumentation
39+
with:
40+
doc: doc_html
Lines changed: 289 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,289 @@
1+
# ==================================================================================================================== #
2+
# Authors: #
3+
# Patrick Lehmann #
4+
# #
5+
# ==================================================================================================================== #
6+
# Copyright 2020-2026 The pyTooling Authors #
7+
# #
8+
# Licensed under the Apache License, Version 2.0 (the "License"); #
9+
# you may not use this file except in compliance with the License. #
10+
# You may obtain a copy of the License at #
11+
# #
12+
# http://www.apache.org/licenses/LICENSE-2.0 #
13+
# #
14+
# Unless required by applicable law or agreed to in writing, software #
15+
# distributed under the License is distributed on an "AS IS" BASIS, #
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
17+
# See the License for the specific language governing permissions and #
18+
# limitations under the License. #
19+
# #
20+
# SPDX-License-Identifier: Apache-2.0 #
21+
# ==================================================================================================================== #
22+
name: Documentation
23+
24+
on:
25+
workflow_call:
26+
inputs:
27+
ubuntu_image_version:
28+
description: 'Ubuntu image version.'
29+
required: false
30+
default: '24.04'
31+
type: string
32+
python_version:
33+
description: 'Python version.'
34+
required: false
35+
default: '3.14'
36+
type: string
37+
requirements:
38+
description: 'Python dependencies to be installed through pip.'
39+
required: false
40+
default: '-r doc/requirements.txt'
41+
type: string
42+
doc_directory:
43+
description: 'Path to the directory containing documentation (Sphinx working directory).'
44+
required: false
45+
default: 'doc'
46+
type: string
47+
html_artifact:
48+
description: 'Name of the HTML documentation artifact.'
49+
required: false
50+
default: ''
51+
type: string
52+
latex_artifact:
53+
description: 'Name of the LaTeX documentation artifact.'
54+
required: false
55+
default: ''
56+
type: string
57+
58+
jobs:
59+
Sphinx-HTML:
60+
name: 📓 HTML Documentation using Sphinx and Python ${{ inputs.python_version }}
61+
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
62+
if: inputs.html_artifact != ''
63+
64+
steps:
65+
- name: ⏬ Checkout repository
66+
uses: actions/checkout@v6
67+
with:
68+
lfs: true
69+
submodules: true
70+
71+
- name: 🔧 Install tcllib
72+
run: sudo apt-get install -y --no-install-recommends tcllib
73+
74+
- name: 🔧 Install Ruff!
75+
run: |
76+
export TCLLIBPATH="$(pwd)/myTCLLibrary"
77+
78+
curl -L --output ruff.zip https://github.com/apnadkarni/ruff/archive/refs/heads/master.zip
79+
unzip -q ruff.zip
80+
81+
mkdir -p ${TCLLIBPATH}/ruff
82+
cp -R ruff-master/src/* ${TCLLIBPATH}/ruff
83+
tree ${TCLLIBPATH}
84+
85+
tclsh - << EOF
86+
puts "auto_path:"
87+
foreach path \$auto_path {
88+
puts " \$path"
89+
}
90+
puts ""
91+
puts "Loading Ruff ..."
92+
puts "Ruff version: [package require ruff]"
93+
EOF
94+
95+
printf -- "\n"
96+
printf -- "Export environment variables:\n"
97+
tee --append $GITHUB_ENV << EOF
98+
TCLLIBPATH=${TCLLIBPATH}
99+
EOF
100+
101+
# - name: 🔧 Install graphviz
102+
# run: sudo apt-get install -y --no-install-recommends graphviz
103+
104+
- name: 🐍 Setup Python ${{ inputs.python_version }}
105+
uses: actions/setup-python@v6
106+
with:
107+
python-version: ${{ inputs.python_version }}
108+
109+
- name: 🔧 Install wheel and pip dependencies (native)
110+
run: |
111+
python -m pip install --disable-pip-version-check -U wheel
112+
python -m pip install --disable-pip-version-check ${{ inputs.requirements }}
113+
114+
- name: ☑ Generate HTML documentation
115+
run: |
116+
export PYTHONPATH=$(pwd)
117+
118+
cd "${{ inputs.doc_directory || '.' }}"
119+
./build.sh --verbose --all --html
120+
121+
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Generated documentation ..."
122+
tree _build
123+
printf "::endgroup::\n"
124+
125+
- name: 📤 Upload 'HTML Documentation' artifact
126+
uses: pyTooling/upload-artifact@v6
127+
continue-on-error: true
128+
with:
129+
name: ${{ inputs.html_artifact }}
130+
working-directory: ${{ inputs.doc_directory }}/_build/html
131+
path: '*'
132+
if-no-files-found: error
133+
retention-days: 1
134+
135+
Sphinx-LaTeX:
136+
name: 📓 LaTeX Documentation using Sphinx and Python ${{ inputs.python_version }}
137+
runs-on: "ubuntu-${{ inputs.ubuntu_image_version }}"
138+
if: inputs.latex_artifact != ''
139+
140+
steps:
141+
- name: ⏬ Checkout repository
142+
uses: actions/checkout@v6
143+
with:
144+
lfs: true
145+
submodules: true
146+
147+
- name: 🔧 Install tcllib
148+
run: sudo apt-get install -y --no-install-recommends tcllib
149+
150+
- name: 🔧 Install Ruff!
151+
run: |
152+
export TCLLIBPATH="$(pwd)/myTCLLibrary"
153+
154+
curl -L --output ruff.zip https://github.com/apnadkarni/ruff/archive/refs/heads/master.zip
155+
unzip -q ruff.zip
156+
157+
mkdir -p ${TCLLIBPATH}/ruff
158+
cp -R ruff-master/src/* ${TCLLIBPATH}/ruff
159+
tree ${TCLLIBPATH}
160+
161+
tclsh - << EOF
162+
puts "auto_path:"
163+
foreach path \$auto_path {
164+
puts " \$path"
165+
}
166+
puts ""
167+
puts "Loading Ruff ..."
168+
puts "Ruff version: [package require ruff]"
169+
EOF
170+
171+
printf -- "\n"
172+
printf -- "Export environment variables:\n"
173+
tee --append $GITHUB_ENV << EOF
174+
TCLLIBPATH=${TCLLIBPATH}
175+
EOF
176+
177+
# - name: 🔧 Install graphviz
178+
# run: sudo apt-get install -y --no-install-recommends graphviz
179+
180+
- name: 🐍 Setup Python ${{ inputs.python_version }}
181+
uses: actions/setup-python@v6
182+
with:
183+
python-version: ${{ inputs.python_version }}
184+
185+
- name: 🔧 Install wheel and pip dependencies (native)
186+
run: |
187+
python -m pip install --disable-pip-version-check -U wheel
188+
python -m pip install --disable-pip-version-check ${{ inputs.requirements }}
189+
190+
- name: ☑ Generate LaTeX documentation
191+
run: |
192+
export PYTHONPATH=$(pwd)
193+
194+
cd "${{ inputs.doc_directory || '.' }}"
195+
./build.sh --verbose --all --latex
196+
197+
printf "::group::${ANSI_LIGHT_BLUE}%s${ANSI_NOCOLOR}\n" "Generated documentation ..."
198+
tree _build
199+
printf "::endgroup::\n"
200+
201+
- name: Workaround I - https://github.com/sphinx-doc/sphinx/issues/13190
202+
run: |
203+
printf "Changing directory to '${{ inputs.doc_directory || '.' }}/_build/latex' ...\n"
204+
cd ${{ inputs.doc_directory || '.' }}/_build/latex
205+
206+
MIMETYPE_EXTENSIONS=(
207+
"image/png:png"
208+
"image/jpeg:jpg"
209+
"image/svg+xml:svg"
210+
)
211+
212+
printf "Changing file extension according to MIME type ...\n"
213+
while IFS=$'\n' read -r file; do
214+
printf " Checking '%s' ... " "${file}"
215+
mime="$(file --mime-type -b "${file}")"
216+
printf "[%s]\n" "${mime}"
217+
218+
found=0
219+
for MIME in "${MIMETYPE_EXTENSIONS[@]}"; do
220+
mimetype="${MIME%%:*}"
221+
extension="${MIME#*:}"
222+
223+
if [[ "${mime}" == "${mimetype}" && "${file##*.}" != "${extension}" ]]; then
224+
printf " Rename file to '%s' " "${file}.${extension}"
225+
mv "${file}" "${file}.${extension}"
226+
if [[ $? -eq 0 ]]; then
227+
printf "[OK]\n"
228+
else
229+
printf "[FAILED]\n"
230+
fi
231+
232+
printf " Patching LaTeX file for '%s' " "${file}"
233+
sed -i "s:{{${file%.*}}\.${file##*.}}:{{${file}}.${extension}}:g" *.tex
234+
if [[ $? -eq 0 ]]; then
235+
printf "[OK]\n"
236+
else
237+
printf "[FAILED]\n"
238+
fi
239+
240+
found=1
241+
break
242+
fi
243+
done
244+
if [[ $found -eq 0 ]]; then
245+
printf "[SKIPPED]\n"
246+
fi
247+
done < <(find . -type f -not -iname "*.cls" -not -iname "*.sty" -not -iname "*.xdy" -not -iname "*.svg" -not -iname "*.png" -not -iname "*.jpg" | sed 's:./::')
248+
249+
- name: Workaround II - https://github.com/sphinx-doc/sphinx/issues/13189
250+
run: |
251+
printf "Changing directory to '${{ inputs.doc_directory || '.' }}/_build/latex' ...\n"
252+
cd ${{ inputs.doc_directory || '.' }}/_build/latex
253+
254+
printf "Searching for downloaded images, that need normalization ...\n"
255+
for imageExt in png svg jpg jpeg; do
256+
printf " Processing '%s' ...\n" "${imageExt}"
257+
while IFS=$'\n' read -r imageFile; do
258+
newFile="${imageFile//%/_}";
259+
260+
printf " %s\n" "$imageFile";
261+
if [[ "${imageFile}" != "${newFile}" ]]; then
262+
printf " Rename file to '%s' " "${newFile}"
263+
mv "${imageFile}" "${newFile}"
264+
if [[ $? -eq 0 ]]; then
265+
printf "[OK]\n"
266+
else
267+
printf "[FAILED]\n"
268+
fi
269+
270+
printf " Patching LaTeX file for '%s' " "${newFile}"
271+
sed -i "s:{{${imageFile%.*}}\.${imageFile##*.}}:{{${newFile%.*}}.${newFile##*.}}:g" *.tex
272+
if [[ $? -eq 0 ]]; then
273+
printf "[OK]\n"
274+
else
275+
printf "[FAILED]\n"
276+
fi
277+
fi
278+
done < <(find . -type f -iname "*.$imageExt" | sed 's:./::')
279+
done
280+
281+
- name: 📤 Upload 'LaTeX Documentation' artifact
282+
uses: pyTooling/upload-artifact@v6
283+
continue-on-error: true
284+
with:
285+
name: ${{ inputs.latex_artifact }}
286+
working-directory: ${{ inputs.doc_directory }}/_build/latex
287+
path: '*'
288+
if-no-files-found: error
289+
retention-days: 1

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
LocalScriptDefaults.tcl
2-
OsvvmSettingsLocal.tcl
2+
OsvvmSettingsLocal.tcl
3+
4+
# Documentation
5+
/doc/_build/
6+
/doc/osvvm-scripts/

0 commit comments

Comments
 (0)