-
Notifications
You must be signed in to change notification settings - Fork 10
74 lines (64 loc) · 1.93 KB
/
isocomp.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Python package with Poetry and MkDocs Deploy
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Cache Poetry dependencies
uses: actions/cache@v2
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install dependencies using Poetry
run: |
poetry install
- name: Lint with flake8 using Poetry
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 80 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=80 --statistics
- name: Test with pytest using Poetry
run: |
poetry run python -m pytest
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install MkDocs
run: pip install mkdocs
- name: Build MkDocs documentation
run: mkdocs build
- name: Deploy to GitHub Pages
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
mkdocs gh-deploy --force
- name: Clean up
run: |
rm -rf site