Skip to content

Suggestion to add a battery counter #83

Suggestion to add a battery counter

Suggestion to add a battery counter #83

Workflow file for this run

name: 'Run test suite'
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- opened
- synchronize
- reopened
- ready_for_review
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m venv .venv
if [ "$RUNNER_OS" == "Windows" ]; then
.\.venv\Scripts\Activate.ps1
else
source .venv/bin/activate
fi
python -m ensurepip --upgrade
pip install -r requirements-dev.txt
- name: Run tests
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
.\.venv\Scripts\Activate.ps1
else
source .venv/bin/activate
fi
pytest -v
format:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m venv .venv
source .venv/bin/activate
python -m ensurepip --upgrade
pip install ruff
- name: Run Ruff
id: ruff
run: |
source .venv/bin/activate
# It would be nice to push the changes back to the PR branch, but that's difficult to do with forks
ruff check --select I --exit-non-zero-on-fix --output-format=github
ruff format
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Python Vulture Action
run: |
python -m venv .venv
source .venv/bin/activate
python -m ensurepip --upgrade
pip install vulture
vulture src