Manage CI build workflow and tasks using MISE-EN-PLACE to install dependencies, lint, run unit tests with coverage, run the utility, and print project info for a small Python utilities project.
This repository contains a small Python utility module (utilities/util.py) that provides robust temperature conversion functions with strict input validation and a custom exception type. Tests are defined in tests/test_util.py and run with pytest.
The project uses MISE-EN-PLACE to manage tooling, virtualenvs, and common tasks via mise.toml. The repository also includes scripts/trust-mise.sh to help trust the mise.toml configuration when running in CI or locally.
If you have mise installed, the project defines convenient tasks in mise.toml. Typical workflow:
# Trust the mise.toml (one-time; creates a .mise_trusted marker)
bash scripts/trust-mise.sh
# Install dependencies and tools defined by mise
mise run install
# Run tests (runs lint -> install -> pytest)
mise run test
# Run tests with coverage and generate XML/HTML reports
mise run coverage
# Run the full build pipeline
mise run buildpython -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Lint
pylint utilities/
# Run tests
pytest -q
# Coverage reports
pytest --cov=utilities --cov-report=xml:tests/coverage/coverage.xml --cov-report=html:tests/coverage/html tests/utilities/util.py— temperature conversion utilities andTemperatureFormatNotSupportedexception.tests/test_util.py— unit tests usingpytest.mise.toml— MISE tasks and env configuration.scripts/trust-mise.sh— helper to trustmise.toml..github/workflows/ci.yml— CI workflow that uses MISE in GitHub Actions.
The CI workflow uploads test coverage artifacts produced by the coverage task. After a workflow run you can download:
coverage-xml- thetests/coverage/coverage.xmlfile (Cobertura/coverage tools friendly).coverage-html- thetests/coverage/htmldirectory containing the HTML report.
To reproduce these artifacts locally run:
mise run coverage
# or with pytest directly:
pytest --cov=utilities --cov-report=xml:tests/coverage/coverage.xml --cov-report=html:tests/coverage/html tests/Contributions, issues and feature requests are welcome. For CI-related changes, keep mise.toml in sync with workflow expectations.
You can validate the CI workflow YAML locally (useful when editing .github/workflows/ci.yml):
# Create and activate a virtualenv, then install dependencies
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Run the YAML sanity check (provided by the lint task)
python -c "import sys, yaml, pathlib; p=pathlib.Path('.github/workflows/ci.yml'); data=p.read_text(); yaml.safe_load(data); print('GitHub Actions workflow YAML file sanity check OK.')"When CI runs, the workflow adds a small run summary which includes a link to the Actions artifacts page for the run. Open the workflow run in the Actions tab and look for the "Build artifacts" section in the run summary (top of the run page) with a link to download the uploaded artifacts.