Repository navigation
100 lines (85 loc) · 2.4 KB
/
Copy pathpython-app.yml
File metadata and controls
100 lines (85 loc) · 2.4 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: CI/CD for mofstructure
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
env:
REGISTRY: docker.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Cache Poetry virtual environment
uses: actions/cache@v4
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Install dependencies
run: |
poetry install --no-interaction --no-ansi
- name: Lint with flake8
run: |
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
poetry run pytest
- name: Build Sphinx Documentation
run: |
poetry run sphinx-build -b html docs/source/ docs/build/html
- name: Upload Sphinx Documentation Artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
# Uncomment this section to publish the package to PyPI after successful build and test
# publish:
# runs-on: ubuntu-latest
# needs: build
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Set up Python 3.10
# uses: actions/setup-python@v5
# with:
# python-version: '3.10'
#
# - name: Install Poetry
# run: |
# python -m pip install --upgrade pip
# pip install poetry
#
# - name: Publish to PyPI
# env:
# POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI }}
# run: |
# poetry config pypi-token.pypi $POETRY_PYPI_TOKEN_PYPI
# poetry publish --build --username __token__ --password $POETRY_PYPI_TOKEN_PYPI