Skip to content

Bump whenever from 0.10.5 to 0.11.0 #689

Bump whenever from 0.10.5 to 0.11.0

Bump whenever from 0.10.5 to 0.11.0 #689

Workflow file for this run

name: CI
on:
workflow_dispatch:
release:
types:
- published
push:
paths:
- "uv.lock"
- "pyproject.toml"
- "src/**"
- "hass-addon-sunsynk-multi/**"
- "hass-addon-sunsynk-edge/**"
- ".github/workflows/deploy-sunsynk.yml"
- ".github/workflows/ci.yml"
pull_request:
paths:
- "uv.lock"
- "pyproject.toml"
- "src/**"
- "hass-addon-sunsynk-multi/**"
- "hass-addon-sunsynk-edge/**"
- ".github/workflows/deploy-sunsynk.yml"
- ".github/workflows/ci.yml"
env:
RUFF_VERSION: 0.16.5
UV_VERSION: 0.12.1
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: chartboost/ruff-action@v1
with:
version: ${{ env.RUFF_VERSION }}
- uses: chartboost/ruff-action@v1
with:
args: "format --check"
version: ${{ env.RUFF_VERSION }}
zuban:
name: Check zuban
needs: [ruff]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: "Set up Python"
uses: actions/setup-python@v7
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
- name: Install Requirements
run: uv sync --frozen --extra solarman
- name: Run zuban
run: uv run zuban check src
pytest:
name: Run tests Python ${{ matrix.python-version }}
needs: [ruff]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.12", "3.13", "3.14"]
env:
PYTHON: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v7
- name: "Set up Python"
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
- name: Install Requirements
run: uv sync --frozen --extra solarman
- name: Run tests and generate coverage report
run: uv run pytest -vv
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON
verbose: true
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
needs:
- pytest
permissions:
id-token: write # used for trusted publishing
steps:
- uses: actions/checkout@v7
- name: "Set up Python"
uses: actions/setup-python@v7
with:
python-version-file: "pyproject.toml"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: ${{ env.UV_VERSION }}
- name: Check tag matches pyproject.toml
run: |
TAG="${GITHUB_REF_NAME#v}" # allow v0.9.3 or 0.9.3
VER=$(sed -n 's/^version = "\([^"]*\)"/\1/p' pyproject.toml | head -1)
echo "tag=$TAG pyproject=$VER"
if [ "$TAG" = "$VER" ]; then
echo "::notice title=Version check::tag=$TAG matches pyproject.toml"
else
echo "::error title=Version mismatch::tag=$TAG does not match pyproject.toml ($VER)"
exit 1
fi
- name: Build a binary wheel and a source tarball
run: uv build
- name: Publish distribution 📦 to PyPI
run: uv publish