-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (59 loc) · 1.5 KB
/
python-package.yml
File metadata and controls
64 lines (59 loc) · 1.5 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
name: Python Package
on:
push:
pull_request:
env:
RUFF_VERSION: "0.11.11"
MYPY_VERSION: "1.13.0"
jobs:
static_code_analysis:
name: Ruff
runs-on: ubuntu-latest
container:
image: python:3.11-alpine
steps:
- uses: actions/checkout@v4
- name: Install Ruff
run: python3 -m pip install ruff==${{ env.RUFF_VERSION }}
- name: Run Ruff
run: python3 -m ruff check src
build:
name: Build Package
runs-on: ubuntu-latest
needs: static_code_analysis
container:
image: python:3.11-alpine
steps:
- uses: actions/checkout@v4
- name: Install build
run: python3 -m pip install build
- name: Build package
run: python3 -m build
- name: Upload built package
uses: actions/upload-artifact@v4
with:
name: dist
path: |
dist/*.whl
dist/*.tar.gz
retention-days: 1
type_checks:
name: MyPy
runs-on: ubuntu-latest
needs: build
container:
image: python:3.11-alpine
steps:
- uses: actions/checkout@v4
- name: Download built package
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Install mypy and dependencies
run: |
python3 -m pip install mypy==${{ env.MYPY_VERSION }}
python3 -m pip install -r requirements/typing.txt
python3 -m pip install dist/*.whl
- name: Run mypy
run: python3 -m mypy src