Skip to content

Add python server test + python coverage + mypy + pyproject meta adde… #30

Add python server test + python coverage + mypy + pyproject meta adde…

Add python server test + python coverage + mypy + pyproject meta adde… #30

Workflow file for this run

name: Python
on:
push:
paths:
- "openapi.yaml"
- "python/remotebmi/**"
- "python/tests/**"
- .github/workflows/python.yml
pull_request:
paths:
- "openapi.yaml"
- "python/remotebmi/**"
- "python/tests/**"
- .github/workflows/python.yml
types: [opened, reopened]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write # This is required for codecov
defaults:
run:
working-directory: python
jobs:
lint-format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install ruff
run: pip install ruff
- name: Run ruff check
run: ruff check
- name: Run ruff format
run: ruff format --check
typing:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install mypy
run: pip install mypy
- name: Run mypy
run: mypy .
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install dependencies
run: pip install -e .[dev]
- name: Run tests
run: pytest --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
file: coverage.xml
use_oidc: true
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pip"
- name: Install build
run: pip install build
- name: Build package
run: python3 -m build