From 96987705eae16cf5768396eddbea6cf52d152105 Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Mon, 9 Feb 2026 20:11:00 -0500 Subject: Replace github actions with sourcehut CI --- scripts/test.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 scripts/test.sh (limited to 'scripts/test.sh') diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100755 index 0000000..5165512 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1,43 @@ +#!/bin/sh +set -e + +PYTHON_VERSION="" + +main() { + parse_args "$@" + if [ -n "$PYTHON_VERSION" ]; then + uv python install "$PYTHON_VERSION" + uv python pin "$PYTHON_VERSION" + fi + uv sync --group test + uv run pytest tests/ --cov=lirc/ -v --cov-report term-missing +} + +usage() { + echo "Usage: $0 [-h|--help] [-p|--python VERSION]" + echo "" + echo "Options:" + echo " -h, --help Show this help message and exit" + echo " -p, --python Specific python version to install and use for the test run" +} + +parse_args() { + while [ $# -gt 0 ]; do + case "$1" in + -h | --help) + usage + exit 0 + ;; + -p | --python) + PYTHON_VERSION="$2" + shift 2 + ;; + *) + usage + exit 1 + ;; + esac + done +} + +main "$@" -- cgit v1.2.3