add CI for docs

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
Michele Dolfi 2024-10-17 09:00:19 +02:00
parent d6d50e7ce7
commit 1c7c5b6254
5 changed files with 50 additions and 20 deletions

View File

@ -23,6 +23,12 @@ jobs:
code-checks: code-checks:
uses: ./.github/workflows/checks.yml uses: ./.github/workflows/checks.yml
build-deploy-docs:
uses: ./.github/workflows/docs.yml
with:
deploy: true
permissions:
contents: write
pre-release-check: pre-release-check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:

View File

@ -16,13 +16,7 @@ env:
jobs: jobs:
code-checks: code-checks:
uses: ./.github/workflows/checks.yml uses: ./.github/workflows/checks.yml
build-deploy-docs:
# To enable when we add the ./docs uses: ./.github/workflows/docs.yml
# build-docs: with:
# runs-on: ubuntu-latest deploy: false
# steps:
# - uses: actions/checkout@v3
# - uses: ./.github/actions/setup-poetry
# - name: Build docs
# run: poetry run mkdocs build --verbose --clean

28
.github/workflows/docs.yml vendored Normal file
View File

@ -0,0 +1,28 @@
on:
workflow_call:
inputs:
deploy:
type: boolean
description: "If true, the docs will be deployed."
default: false
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install poetry
run: pipx install poetry==1.8.3
shell: bash
- uses: actions/setup-python@v4
with:
cache: 'poetry'
- name: Install dependencies
run: poetry install --only docs
shell: bash
- name: Build docs
run: poetry run mkdocs build --verbose --clean
- name: Build and push docs
if: inputs.deploy
run: poetry run mkdocs gh-deploy --force

20
poetry.lock generated
View File

@ -196,8 +196,8 @@ files = [
lazy-object-proxy = ">=1.4.0" lazy-object-proxy = ">=1.4.0"
typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""} typing-extensions = {version = ">=4.0.0", markers = "python_version < \"3.11\""}
wrapt = [ wrapt = [
{version = ">=1.14,<2", markers = "python_version >= \"3.11\""},
{version = ">=1.11,<2", markers = "python_version < \"3.11\""}, {version = ">=1.11,<2", markers = "python_version < \"3.11\""},
{version = ">=1.14,<2", markers = "python_version >= \"3.11\""},
] ]
[[package]] [[package]]
@ -943,8 +943,8 @@ networkx = ">=3.1,<4.0"
netwulf = ">=0.1.5,<0.2.0" netwulf = ">=0.1.5,<0.2.0"
numerize = ">=0.12,<0.13" numerize = ">=0.12,<0.13"
numpy = [ numpy = [
{version = ">=2.0.2,<3.0.0", markers = "python_version >= \"3.13\""},
{version = ">=1.26.4,<2.0.0", markers = "python_version >= \"3.9\" and python_version < \"3.13\""}, {version = ">=1.26.4,<2.0.0", markers = "python_version >= \"3.9\" and python_version < \"3.13\""},
{version = ">=2.0.2,<3.0.0", markers = "python_version >= \"3.13\""},
] ]
pandas = {version = ">=2.1.4,<3.0.0", markers = "python_version >= \"3.9\""} pandas = {version = ">=2.1.4,<3.0.0", markers = "python_version >= \"3.9\""}
python-dotenv = ">=1.0.0,<2.0.0" python-dotenv = ">=1.0.0,<2.0.0"
@ -1030,8 +1030,8 @@ jsonlines = ">=3.1.0,<4.0.0"
lxml = ">=4.9.1,<5.0.0" lxml = ">=4.9.1,<5.0.0"
mean_average_precision = ">=2021.4.26.0,<2022.0.0.0" mean_average_precision = ">=2021.4.26.0,<2022.0.0.0"
numpy = [ numpy = [
{version = ">=2.1.0,<3.0.0", markers = "python_version >= \"3.13\""},
{version = ">=1.24.4,<2.0.0", markers = "python_version < \"3.13\""}, {version = ">=1.24.4,<2.0.0", markers = "python_version < \"3.13\""},
{version = ">=2.1.0,<3.0.0", markers = "python_version >= \"3.13\""},
] ]
opencv-python-headless = ">=4.6.0.66,<5.0.0.0" opencv-python-headless = ">=4.6.0.66,<5.0.0.0"
Pillow = ">=10.0.0,<11.0.0" Pillow = ">=10.0.0,<11.0.0"
@ -2355,8 +2355,8 @@ jsonpatch = ">=1.33,<2.0"
langsmith = ">=0.1.112,<0.2.0" langsmith = ">=0.1.112,<0.2.0"
packaging = ">=23.2,<25" packaging = ">=23.2,<25"
pydantic = [ pydantic = [
{version = ">=2.7.4,<3.0.0", markers = "python_full_version >= \"3.12.4\""},
{version = ">=1,<3", markers = "python_full_version < \"3.12.4\""}, {version = ">=1,<3", markers = "python_full_version < \"3.12.4\""},
{version = ">=2.7.4,<3.0.0", markers = "python_full_version >= \"3.12.4\""},
] ]
PyYAML = ">=5.3" PyYAML = ">=5.3"
tenacity = ">=8.1.0,<8.4.0 || >8.4.0,<9.0.0" tenacity = ">=8.1.0,<8.4.0 || >8.4.0,<9.0.0"
@ -2424,8 +2424,8 @@ files = [
httpx = ">=0.23.0,<1" httpx = ">=0.23.0,<1"
orjson = ">=3.9.14,<4.0.0" orjson = ">=3.9.14,<4.0.0"
pydantic = [ pydantic = [
{version = ">=2.7.4,<3.0.0", markers = "python_full_version >= \"3.12.4\""},
{version = ">=1,<3", markers = "python_full_version < \"3.12.4\""}, {version = ">=1,<3", markers = "python_full_version < \"3.12.4\""},
{version = ">=2.7.4,<3.0.0", markers = "python_full_version >= \"3.12.4\""},
] ]
requests = ">=2,<3" requests = ">=2,<3"
requests-toolbelt = ">=1.0.0,<2.0.0" requests-toolbelt = ">=1.0.0,<2.0.0"
@ -3737,10 +3737,10 @@ files = [
[package.dependencies] [package.dependencies]
numpy = [ numpy = [
{version = ">=1.26.0", markers = "python_version >= \"3.12\""},
{version = ">=1.21.4", markers = "python_version >= \"3.10\" and platform_system == \"Darwin\" and python_version < \"3.11\""}, {version = ">=1.21.4", markers = "python_version >= \"3.10\" and platform_system == \"Darwin\" and python_version < \"3.11\""},
{version = ">=1.21.2", markers = "platform_system != \"Darwin\" and python_version >= \"3.10\" and python_version < \"3.11\""}, {version = ">=1.21.2", markers = "platform_system != \"Darwin\" and python_version >= \"3.10\" and python_version < \"3.11\""},
{version = ">=1.23.5", markers = "python_version >= \"3.11\" and python_version < \"3.12\""}, {version = ">=1.23.5", markers = "python_version >= \"3.11\" and python_version < \"3.12\""},
{version = ">=1.26.0", markers = "python_version >= \"3.12\""},
] ]
[[package]] [[package]]
@ -3888,9 +3888,9 @@ files = [
[package.dependencies] [package.dependencies]
numpy = [ numpy = [
{version = ">=1.26.0", markers = "python_version >= \"3.12\""},
{version = ">=1.22.4", markers = "python_version < \"3.11\""}, {version = ">=1.22.4", markers = "python_version < \"3.11\""},
{version = ">=1.23.2", markers = "python_version == \"3.11\""}, {version = ">=1.23.2", markers = "python_version == \"3.11\""},
{version = ">=1.26.0", markers = "python_version >= \"3.12\""},
] ]
python-dateutil = ">=2.8.2" python-dateutil = ">=2.8.2"
pytz = ">=2020.1" pytz = ">=2020.1"
@ -4480,8 +4480,8 @@ files = [
annotated-types = ">=0.6.0" annotated-types = ">=0.6.0"
pydantic-core = "2.23.4" pydantic-core = "2.23.4"
typing-extensions = [ typing-extensions = [
{version = ">=4.12.2", markers = "python_version >= \"3.13\""},
{version = ">=4.6.1", markers = "python_version < \"3.13\""}, {version = ">=4.6.1", markers = "python_version < \"3.13\""},
{version = ">=4.12.2", markers = "python_version >= \"3.13\""},
] ]
[package.extras] [package.extras]
@ -4649,8 +4649,8 @@ files = [
astroid = ">=2.15.8,<=2.17.0-dev0" astroid = ">=2.15.8,<=2.17.0-dev0"
colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""} colorama = {version = ">=0.4.5", markers = "sys_platform == \"win32\""}
dill = [ dill = [
{version = ">=0.3.6", markers = "python_version >= \"3.11\""},
{version = ">=0.2", markers = "python_version < \"3.11\""}, {version = ">=0.2", markers = "python_version < \"3.11\""},
{version = ">=0.3.6", markers = "python_version >= \"3.11\""},
] ]
isort = ">=4.2.5,<6" isort = ">=4.2.5,<6"
mccabe = ">=0.6,<0.8" mccabe = ">=0.6,<0.8"
@ -7513,4 +7513,4 @@ tesserocr = ["tesserocr"]
[metadata] [metadata]
lock-version = "2.0" lock-version = "2.0"
python-versions = "^3.10" python-versions = "^3.10"
content-hash = "8eb8024c32b37b2367c8d83e2833c3d118b3cfdd2f53966712c95dec8d830199" content-hash = "ba5b52f1a318810bd363d2aa4f60fdfc2e5899e1729b0f0c51026082c93d23e0"

View File

@ -75,6 +75,8 @@ pandas-stubs = "^2.1.4.231227"
ipykernel = "^6.29.5" ipykernel = "^6.29.5"
ipywidgets = "^8.1.5" ipywidgets = "^8.1.5"
nbqa = "^1.9.0" nbqa = "^1.9.0"
[tool.poetry.group.docs.dependencies]
mkdocs-material = "^9.5.40" mkdocs-material = "^9.5.40"
mkdocs-jupyter = "^0.25.0" mkdocs-jupyter = "^0.25.0"