-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (32 loc) · 1.24 KB
/
Copy pathpython-app.yml
File metadata and controls
36 lines (32 loc) · 1.24 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
# Installs dependencies, lints, type-checks, and tests using the same
# toolchain as local development (mise-managed Python + uv; see mise.toml).
name: Python application
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up toolchain with mise (Python + uv, matches dev env)
uses: jdx/mise-action@v2
with:
install: true
cache: true
- name: Install dependencies
# mise.toml provisions Python 3.13 + uv and creates .venv; install the
# project with its dev extras (pytest, flake8, mypy) into that venv.
run: mise exec -- uv pip install -e ".[dev]"
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
mise exec -- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
mise exec -- flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Type-check with mypy
run: mise exec -- mypy optimizerapi
- name: Test with pytest
run: mise exec -- python -m pytest