Prepare python publish #31
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |