-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (87 loc) · 2.39 KB
/
python-commit.yml
File metadata and controls
110 lines (87 loc) · 2.39 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
101
102
103
104
105
106
107
108
109
110
name: CI Pipeline
on:
push:
branches:
- main
pull_request:
jobs:
lint-test-build:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev] black mypy bandit pytest
- name: Lint with Black
run: black --check --diff .
- name: Type check with mypy
run: mypy --ignore-missing-imports --install-types --non-interactive .
- name: Security scan with Bandit
run: bandit -r src
# - name: Run tests
# run: pytest -v -s
build-docs:
runs-on: ubuntu-latest
needs: lint-test-build
if: ${{ success() }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[dev] pdoc
- name: Clean old docs
run: rm -rf docs
- name: Build Docs
run: pdoc pyke -o docs
- name: Upload Docs
uses: actions/upload-artifact@v4
with:
name: docs
path: docs
deploy-docs:
runs-on: ubuntu-latest
needs: build-docs
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: docs
path: docs
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./docs
destination: ./_site
- name: Upload to GitHub Pages
id: deployment
uses: actions/upload-pages-artifact@v3
with:
path: ./_site
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
id: deploy