Skip to content

Commit

Permalink
add PR check
Browse files Browse the repository at this point in the history
  • Loading branch information
pkucmus committed Jan 1, 2022
1 parent 0b5d023 commit faad436
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 28 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/check-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: check_build
on: pull_request

env:
PYTHON_VERSION: 3.10.1

jobs:
check_build:
name: Check documentation for errors
runs-on: ubuntu-latest
steps:

- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Python runtime
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
poetry config --list
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install Python dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install Python dependencies
run: poetry install --no-interaction

- name: Check docs build
run: poetry run mkdocs build -s

# - name: Archive docs artifacts
# uses: actions/upload-artifact@v2
# with:
# name: site-without-models
# path: |
# site
# !site/**/*.stl
# !site/**/*.step
# retention-days: 1
47 changes: 19 additions & 28 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
# Copyright (c) 2016-2020 Martin Donath <[email protected]>

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

name: documentation
on:
push:
branches:
- main

env:
PYTHON_VERSION: 3.8
PYTHON_VERSION: 3.10.1

jobs:
documentation:
Expand All @@ -41,17 +21,28 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Run image
uses: abatilo/[email protected]
- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
poetry config --list
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
poetry-version: 1.1.5
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}

- name: Install Python dependencies
run: |
poetry install
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

- name: Install Python dependencies
run: poetry install --no-interaction

- name: Deploy documentation
# env:
# GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
run: |
poetry run mkdocs gh-deploy --force
poetry run mkdocs --version

0 comments on commit faad436

Please sign in to comment.