Skip to content

Commit

Permalink
Add documentation build test
Browse files Browse the repository at this point in the history
  • Loading branch information
Argmaster committed Nov 11, 2024
1 parent a1db835 commit b7d2d55
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 7 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,42 @@ jobs:

- name: Run tests without extras
run: poetry run poe test-no-extras

docs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8"]

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/[email protected]
with:
fetch-depth: 0
fetch-tags: true

- name: Set up Python ${{ matrix.python-version }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
architecture: "x64"

- name: Install Poetry
run: pip install poetry==1.8.4

- name: Install base dependencies
run: poetry install --no-cache

- name: Prepare environment for docs deploy
run: poetry run poe prepare-deploy-docs

- name: Configure Git
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Deploy documentation
run: poetry run mkdocs build
6 changes: 0 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,6 @@ test-no-extras = [
prepare-deploy-docs = [
{ cmd = "poetry install --sync --with=docs --extras=all --no-ansi" },
]
deploy-latest-docs = [
{ cmd = "poetry run mike deploy --push --update-aliases $(poetry version | awk '{ print $2 }') latest --config-file mkdocs.yaml" }
]
deploy-stable-docs = [
{ cmd = "poetry run mike deploy --push --update-aliases $(poetry version | awk '{ print $2 }') stable --config-file mkdocs.yaml" }
]
# --------- Package ---------
prepare-deploy-package = [
{ cmd = "poetry install --sync --with=deploy --extras=all --no-ansi" },
Expand Down
10 changes: 9 additions & 1 deletion scripts/deploy_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ def main(*, is_dev: bool, check_only: bool) -> None:

sys_argv_original = sys.argv.copy()

sys.argv = ["mike", "deploy", "--push", "--update-aliases", *aliases]
sys.argv = [
"mike",
"deploy",
"--push",
"--update-aliases",
*aliases,
"--config-file",
"mkdocs.yaml",
]
mike_main()

sys.argv = sys_argv_original
Expand Down

0 comments on commit b7d2d55

Please sign in to comment.