Skip to content

Commit faad436

Browse files
committed
add PR check
1 parent 0b5d023 commit faad436

File tree

2 files changed

+72
-28
lines changed

2 files changed

+72
-28
lines changed

.github/workflows/check-build.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: check_build
2+
on: pull_request
3+
4+
env:
5+
PYTHON_VERSION: 3.10.1
6+
7+
jobs:
8+
check_build:
9+
name: Check documentation for errors
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
16+
- name: Set up Python runtime
17+
uses: actions/setup-python@v2
18+
with:
19+
python-version: ${{ env.PYTHON_VERSION }}
20+
21+
- name: Install poetry
22+
run: |
23+
curl -sSL https://install.python-poetry.org | python3 -
24+
poetry config virtualenvs.create true
25+
poetry config virtualenvs.in-project true
26+
poetry config --list
27+
28+
- name: Load cached venv
29+
id: cached-poetry-dependencies
30+
uses: actions/cache@v2
31+
with:
32+
path: .venv
33+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
34+
35+
- name: Install Python dependencies
36+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
37+
run: poetry install --no-interaction --no-root
38+
39+
- name: Install Python dependencies
40+
run: poetry install --no-interaction
41+
42+
- name: Check docs build
43+
run: poetry run mkdocs build -s
44+
45+
# - name: Archive docs artifacts
46+
# uses: actions/upload-artifact@v2
47+
# with:
48+
# name: site-without-models
49+
# path: |
50+
# site
51+
# !site/**/*.stl
52+
# !site/**/*.step
53+
# retention-days: 1
Lines changed: 19 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
1-
# Copyright (c) 2016-2020 Martin Donath <martin.donath@squidfunk.com>
2-
3-
# Permission is hereby granted, free of charge, to any person obtaining a copy
4-
# of this software and associated documentation files (the "Software"), to
5-
# deal in the Software without restriction, including without limitation the
6-
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7-
# sell copies of the Software, and to permit persons to whom the Software is
8-
# furnished to do so, subject to the following conditions:
9-
10-
# The above copyright notice and this permission notice shall be included in
11-
# all copies or substantial portions of the Software.
12-
13-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15-
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
16-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19-
# IN THE SOFTWARE.
20-
211
name: documentation
222
on:
233
push:
244
branches:
255
- main
266

277
env:
28-
PYTHON_VERSION: 3.8
8+
PYTHON_VERSION: 3.10.1
299

3010
jobs:
3111
documentation:
@@ -41,17 +21,28 @@ jobs:
4121
with:
4222
python-version: ${{ env.PYTHON_VERSION }}
4323

44-
- name: Run image
45-
uses: abatilo/actions-poetry@v2.0.0
24+
- name: Install poetry
25+
run: |
26+
curl -sSL https://install.python-poetry.org | python3 -
27+
poetry config virtualenvs.create true
28+
poetry config virtualenvs.in-project true
29+
poetry config --list
30+
31+
- name: Load cached venv
32+
id: cached-poetry-dependencies
33+
uses: actions/cache@v2
4634
with:
47-
poetry-version: 1.1.5
35+
path: .venv
36+
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
4837

4938
- name: Install Python dependencies
50-
run: |
51-
poetry install
39+
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
40+
run: poetry install --no-interaction --no-root
41+
42+
- name: Install Python dependencies
43+
run: poetry install --no-interaction
44+
5245
- name: Deploy documentation
53-
# env:
54-
# GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }}
5546
run: |
5647
poetry run mkdocs gh-deploy --force
5748
poetry run mkdocs --version

0 commit comments

Comments
 (0)