Skip to content

refactor: reduce complexity of forecost_get_cost_summary for xenon #36

refactor: reduce complexity of forecost_get_cost_summary for xenon

refactor: reduce complexity of forecost_get_cost_summary for xenon #36

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- run: pip install -e ".[dev]"
- run: ruff check forecost/ tests/
- run: ruff format --check forecost/ tests/
- run: pyright
- run: xenon forecost/ -b B -m A -a A
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- run: pip install -e ".[dev,forecast]"
- run: bandit -r forecost/ -c pyproject.toml
- run: pip-audit
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- run: pip install -e ".[dev,forecast]"
- run: pytest tests/ -v --tb=short -x
coverage:
runs-on: ubuntu-latest
needs: [lint, security]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- run: pip install -e ".[dev,forecast]"
- run: pytest tests/ --cov=forecost --cov-report=term-missing --cov-report=xml
- run: diff-cover coverage.xml --fail-under 90
- uses: actions/upload-artifact@v4
with:
name: coverage-xml
path: coverage.xml
smoke:
runs-on: ubuntu-latest
needs: [lint, security, test, coverage]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- run: pip install .
- run: forecost --version
- run: forecost --help
- run: forecost demo