mirror of
https://github.com/kanidm/kanidm.git
synced 2025-02-24 04:57:00 +01:00
Sorting documentation builds (#1551)
* updating pykanidm to fix mypy issue * removing mdbook-template requirement
This commit is contained in:
parent
ab49c7f21d
commit
90d4fe1d58
2
.github/workflows/clippy.yml
vendored
2
.github/workflows/clippy.yml
vendored
|
@ -16,6 +16,7 @@ jobs:
|
||||||
clippy:
|
clippy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
- name: Restore our cache
|
- name: Restore our cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
@ -26,7 +27,6 @@ jobs:
|
||||||
~/.cargo/git/db/
|
~/.cargo/git/db/
|
||||||
target/
|
target/
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Update package manager
|
- name: Update package manager
|
||||||
run: sudo apt-get update
|
run: sudo apt-get update
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|
13
.github/workflows/debian_package_kanidm.yml
vendored
13
.github/workflows/debian_package_kanidm.yml
vendored
|
@ -1,8 +1,7 @@
|
||||||
---
|
---
|
||||||
name: "Build Debian Packages"
|
name: "Build Debian Packages"
|
||||||
|
|
||||||
# yamllint disable-line rule:truthy
|
"on":
|
||||||
on:
|
|
||||||
push:
|
push:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
|
||||||
|
@ -15,11 +14,11 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
image:
|
image:
|
||||||
- ubuntu:22.04
|
- ubuntu:22.04
|
||||||
- ubuntu:20.04
|
- ubuntu:20.04
|
||||||
- ubuntu:18.04
|
- ubuntu:18.04
|
||||||
- debian:11
|
- debian:11
|
||||||
- debian:10
|
- debian:10
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.image }}
|
image: ${{ matrix.image }}
|
||||||
|
|
5
.github/workflows/dependabot_auto_merge.yml
vendored
5
.github/workflows/dependabot_auto_merge.yml
vendored
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
# yamllint disable rule:line-length
|
||||||
name: Dependabot auto-approval and auto-merge
|
name: Dependabot auto-approval and auto-merge
|
||||||
"on": pull_request
|
"on": pull_request
|
||||||
|
|
||||||
|
@ -9,7 +10,8 @@ permissions:
|
||||||
jobs:
|
jobs:
|
||||||
dependabot:
|
dependabot:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: ${{ github.actor == 'dependabot[bot]' }} # limit this to PRs opened by dependabot
|
# limit this to PRs opened by dependabot
|
||||||
|
if: ${{ github.actor == 'dependabot[bot]' }}
|
||||||
steps:
|
steps:
|
||||||
- name: Dependabot metadata
|
- name: Dependabot metadata
|
||||||
id: metadata
|
id: metadata
|
||||||
|
@ -20,6 +22,7 @@ jobs:
|
||||||
compat-lookup: true
|
compat-lookup: true
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Approve a PR if not already approved
|
- name: Approve a PR if not already approved
|
||||||
|
|
||||||
run: |
|
run: |
|
||||||
# sets the upstream metadata for `gh pr status`
|
# sets the upstream metadata for `gh pr status`
|
||||||
gh pr checkout "$PR_URL"
|
gh pr checkout "$PR_URL"
|
||||||
|
|
149
.github/workflows/kanidm_book.yml
vendored
149
.github/workflows/kanidm_book.yml
vendored
|
@ -8,64 +8,121 @@ concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
jobs:
|
jobs:
|
||||||
deploy_book:
|
generate_tags:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
tags: ${{ steps.tags.outputs.tags}}
|
||||||
|
latest: ${{ steps.previoustag.outputs.tag }}
|
||||||
steps:
|
steps:
|
||||||
|
- id: tags
|
||||||
|
name: pull tags
|
||||||
|
uses: oraad/get-tags-action@v1.0.0
|
||||||
|
with:
|
||||||
|
repo: ${{ github.repository }}
|
||||||
|
limit: 100
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
clean: false
|
- name: 'Get Previous tag'
|
||||||
|
id: previoustag
|
||||||
- name: Install deps
|
uses: "WyriHaximus/github-action-get-previous-tag@v1"
|
||||||
run: |
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y clang build-essential \
|
|
||||||
librust-openssl-dev libssl-dev \
|
|
||||||
libsqlite3-dev libudev-dev \
|
|
||||||
libpam0g-dev
|
|
||||||
|
|
||||||
- name: Setup deno
|
|
||||||
# Documentation: https://github.com/denoland/setup-deno
|
|
||||||
uses: denoland/setup-deno@v1
|
|
||||||
with:
|
with:
|
||||||
deno-version: v1.x
|
prefix: v1
|
||||||
|
fanout:
|
||||||
|
uses: './.github/workflows/kanidm_individual_book.yml'
|
||||||
|
needs: generate_tags
|
||||||
|
|
||||||
- name: Test document formatting
|
strategy:
|
||||||
run: |
|
fail-fast: false
|
||||||
make doc/format
|
matrix:
|
||||||
|
# tag: ${{ fromJson(needs.generate_tags.outputs.tags) }}
|
||||||
|
tag:
|
||||||
|
- ${{ needs.generate_tags.outputs.latest}}
|
||||||
|
with:
|
||||||
|
tag: ${{ matrix.tag }}
|
||||||
|
parent_id: ${{ github.ref }}
|
||||||
|
docs_master:
|
||||||
|
uses: './.github/workflows/kanidm_individual_book.yml'
|
||||||
|
with:
|
||||||
|
tag: "master"
|
||||||
|
parent_id: ${{ github.ref }}
|
||||||
|
|
||||||
- name: Setup mdBook
|
deploy:
|
||||||
uses: peaceiris/actions-mdbook@v1
|
needs:
|
||||||
|
- fanout
|
||||||
|
- docs_master
|
||||||
|
- generate_tags
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Download previously built docs
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
mdbook-version: "latest"
|
name: docs
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
- name: Extract the files
|
||||||
with:
|
run: |
|
||||||
toolchain: stable
|
find . -name '*.tar.gz' -exec tar zxf "{}" \;
|
||||||
|
ls -la docs/
|
||||||
|
cd docs && ln -s ${{ needs.generate_tags.outputs.latest}}/ stable && cd ..
|
||||||
|
ls -la docs/
|
||||||
|
|
||||||
- uses: actions-rs/cargo@v1
|
|
||||||
with:
|
|
||||||
command: install
|
|
||||||
args: mdbook-template
|
|
||||||
|
|
||||||
- name: Make all the books
|
|
||||||
run: ./scripts/build_all_the_docs.sh
|
|
||||||
|
|
||||||
- name: Install python 3.10
|
# - uses: actions/checkout@v3
|
||||||
uses: actions/setup-python@v4
|
# with:
|
||||||
with:
|
# fetch-depth: 0
|
||||||
python-version: "3.10"
|
# clean: false
|
||||||
|
|
||||||
- name: pykanidm docs
|
# - name: Install deps
|
||||||
run: |
|
# run: |
|
||||||
python -m pip install poetry
|
# sudo apt-get update
|
||||||
make docs/pykanidm/build
|
# sudo apt-get install -y clang build-essential \
|
||||||
mv pykanidm/site ./docs/pykanidm
|
# librust-openssl-dev libssl-dev \
|
||||||
|
# libsqlite3-dev libudev-dev \
|
||||||
|
# libpam0g-dev
|
||||||
|
|
||||||
- name: Deploy
|
# - name: Setup deno
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
# # Documentation: https://github.com/denoland/setup-deno
|
||||||
if: ${{ github.ref == 'refs/heads/master' }}
|
# uses: denoland/setup-deno@v1
|
||||||
with:
|
# with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
# deno-version: v1.x
|
||||||
publish_dir: ./docs
|
|
||||||
destination_dir: ./docs
|
# - name: Test document formatting
|
||||||
|
# run: |
|
||||||
|
# make doc/format
|
||||||
|
|
||||||
|
# - name: Setup mdBook
|
||||||
|
# uses: peaceiris/actions-mdbook@v1
|
||||||
|
# with:
|
||||||
|
# mdbook-version: "latest"
|
||||||
|
|
||||||
|
# - uses: actions-rs/toolchain@v1
|
||||||
|
# with:
|
||||||
|
# toolchain: stable
|
||||||
|
|
||||||
|
# - uses: actions-rs/cargo@v1
|
||||||
|
# with:
|
||||||
|
# command: install
|
||||||
|
# args: mdbook-template
|
||||||
|
|
||||||
|
# - name: Make all the books
|
||||||
|
# run: ./scripts/build_all_the_docs.sh
|
||||||
|
|
||||||
|
# - name: Install python 3.10
|
||||||
|
# uses: actions/setup-python@v4
|
||||||
|
# with:
|
||||||
|
# python-version: "3.10"
|
||||||
|
|
||||||
|
# - name: pykanidm docs
|
||||||
|
# run: |
|
||||||
|
# python -m pip install poetry
|
||||||
|
# make docs/pykanidm/build
|
||||||
|
# mv pykanidm/site ./docs/pykanidm
|
||||||
|
|
||||||
|
# - name: Deploy
|
||||||
|
# uses: peaceiris/actions-gh-pages@v3
|
||||||
|
# if: ${{ github.ref == 'refs/heads/master' }}
|
||||||
|
# with:
|
||||||
|
# github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# publish_dir: ./docs
|
||||||
|
# destination_dir: ./docs
|
||||||
|
|
83
.github/workflows/kanidm_individual_book.yml
vendored
Normal file
83
.github/workflows/kanidm_individual_book.yml
vendored
Normal file
|
@ -0,0 +1,83 @@
|
||||||
|
---
|
||||||
|
name: "Github Pages - Branch"
|
||||||
|
"on":
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
# the target tag for generating things
|
||||||
|
tag:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
# the parent workflow for caching
|
||||||
|
parent_id:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate_mdbook:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
continue-on-error: true
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.tag }}
|
||||||
|
- name: Restore our cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.cargo/bin/
|
||||||
|
~/.cargo/registry/index/
|
||||||
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
target/
|
||||||
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
- name: Install deps
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y clang build-essential \
|
||||||
|
librust-openssl-dev libssl-dev \
|
||||||
|
libsqlite3-dev libudev-dev \
|
||||||
|
libpam0g-dev
|
||||||
|
|
||||||
|
- name: Setup mdBook
|
||||||
|
uses: peaceiris/actions-mdbook@v1
|
||||||
|
with:
|
||||||
|
mdbook-version: "latest"
|
||||||
|
|
||||||
|
- uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
|
||||||
|
- name: Install python 3.10
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: "3.10"
|
||||||
|
|
||||||
|
- name: Build the docs
|
||||||
|
run: |
|
||||||
|
cargo doc --no-deps
|
||||||
|
mdbook build *book
|
||||||
|
rm -rf ./docs/
|
||||||
|
mkdir -p ./docs/${{ inputs.tag }}/rustdoc/
|
||||||
|
mv ./*book/book/ ./docs/${{ inputs.tag }}
|
||||||
|
mv ./target/doc/* ./docs/${{ inputs.tag }}/rustdoc/
|
||||||
|
|
||||||
|
- name: pykanidm docs
|
||||||
|
run: |
|
||||||
|
python -m pip install poetry
|
||||||
|
cd pykanidm
|
||||||
|
poetry install
|
||||||
|
poetry run mkdocs build
|
||||||
|
cd ..
|
||||||
|
mv pykanidm/site ./docs/${{ inputs.tag }}/pykanidm
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
- name: archive things
|
||||||
|
run: |
|
||||||
|
tar czvf ${{ inputs.tag }}.tar.gz ./docs/
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
# https://github.com/actions/upload-artifact
|
||||||
|
uses: actions/upload-artifact@v1
|
||||||
|
with:
|
||||||
|
name: docs
|
||||||
|
path: ${{inputs.tag }}.tar.gz
|
1
.github/workflows/windows_build.yml
vendored
1
.github/workflows/windows_build.yml
vendored
|
@ -48,4 +48,5 @@ jobs:
|
||||||
uses: actions-rs/cargo@v1
|
uses: actions-rs/cargo@v1
|
||||||
with:
|
with:
|
||||||
command: test
|
command: test
|
||||||
|
# yamllint disable-line rule:line-length
|
||||||
args: -p kanidm_client -p kanidm_tools -p orca -p daemon -p kanidmd_core
|
args: -p kanidm_client -p kanidm_tools -p orca -p daemon -p kanidmd_core
|
||||||
|
|
|
@ -63,7 +63,7 @@ build-backend = "poetry.core.masonry.api"
|
||||||
[tool.pylint.MASTER]
|
[tool.pylint.MASTER]
|
||||||
max-line-length=150
|
max-line-length=150
|
||||||
disable="W0511,raise-missing-from"
|
disable="W0511,raise-missing-from"
|
||||||
extension-pkg-whitelist="pydantic"
|
extension-pkg-allow-list="pydantic"
|
||||||
# https://github.com/samuelcolvin/pydantic/issues/1961#issuecomment-759522422
|
# https://github.com/samuelcolvin/pydantic/issues/1961#issuecomment-759522422
|
||||||
load-plugins="pylint_pydantic,pylint_pytest"
|
load-plugins="pylint_pydantic,pylint_pytest"
|
||||||
|
|
||||||
|
@ -87,3 +87,6 @@ markers = [
|
||||||
[tool.coverage.run]
|
[tool.coverage.run]
|
||||||
source = ["kanidm"]
|
source = ["kanidm"]
|
||||||
omit = ["tests"]
|
omit = ["tests"]
|
||||||
|
|
||||||
|
[tool.mypy]
|
||||||
|
plugins = "pydantic.mypy"
|
||||||
|
|
|
@ -22,13 +22,13 @@ def test_auth_init_response() -> None:
|
||||||
def test_radiusgroup_vlan_negative() -> None:
|
def test_radiusgroup_vlan_negative() -> None:
|
||||||
"""tests RadiusGroup's vlan validator"""
|
"""tests RadiusGroup's vlan validator"""
|
||||||
with pytest.raises(pydantic.error_wrappers.ValidationError):
|
with pytest.raises(pydantic.error_wrappers.ValidationError):
|
||||||
RadiusGroup(vlan=-1)
|
RadiusGroup(vlan=-1, spn="crabzrool@foo")
|
||||||
|
|
||||||
|
|
||||||
def test_radiusgroup_vlan_zero() -> None:
|
def test_radiusgroup_vlan_zero() -> None:
|
||||||
"""tests RadiusGroup's vlan validator"""
|
"""tests RadiusGroup's vlan validator"""
|
||||||
with pytest.raises(pydantic.error_wrappers.ValidationError):
|
with pytest.raises(pydantic.error_wrappers.ValidationError):
|
||||||
RadiusGroup(vlan=0)
|
RadiusGroup(vlan=0, spn="crabzrool@foo")
|
||||||
|
|
||||||
|
|
||||||
def test_radiusgroup_vlan_4096() -> None:
|
def test_radiusgroup_vlan_4096() -> None:
|
||||||
|
@ -41,10 +41,7 @@ def test_radiusgroup_vlan_no_name() -> None:
|
||||||
with pytest.raises(
|
with pytest.raises(
|
||||||
pydantic.error_wrappers.ValidationError, match="spn\n.*field required"
|
pydantic.error_wrappers.ValidationError, match="spn\n.*field required"
|
||||||
):
|
):
|
||||||
RadiusGroup(
|
RadiusGroup(vlan=4096) # type: ignore[call-arg]
|
||||||
vlan=4096,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def test_kanidmconfig_parse_toml() -> None:
|
def test_kanidmconfig_parse_toml() -> None:
|
||||||
"""tests KanidmClientConfig.parse_toml()"""
|
"""tests KanidmClientConfig.parse_toml()"""
|
||||||
|
|
Loading…
Reference in a new issue