From de3f4eaa8cff992c5b72e7da702c636eceb13d6b Mon Sep 17 00:00:00 2001 From: Timid Robot Zehta Date: Fri, 7 Nov 2025 09:23:51 +0100 Subject: [PATCH 1/4] add Test Scripts' Help script and workflow --- .github/workflows/test_scripts_help.yml | 34 +++++++++++++++++++ dev/test_scripts_help.sh | 45 +++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 .github/workflows/test_scripts_help.yml create mode 100755 dev/test_scripts_help.sh diff --git a/.github/workflows/test_scripts_help.yml b/.github/workflows/test_scripts_help.yml new file mode 100644 index 00000000..9d37f2b2 --- /dev/null +++ b/.github/workflows/test_scripts_help.yml @@ -0,0 +1,34 @@ +name: Test scripts' help + +on: + push: + workflow_dispatch: + +jobs: + job: + runs-on: ubuntu-latest + + steps: + + # https://github.com/actions/setup-python + - name: Install Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install pipenv + run: | + pip install --upgrade pip + pip install pipenv + + # https://github.com/actions/checkout + - name: Checkout quantifying + uses: actions/checkout@v4 + + - name: Install Python dependencies + run: | + pipenv sync --system + + - name: test scripts' help + run: | + ./dev/test_sripts_help.sh diff --git a/dev/test_scripts_help.sh b/dev/test_scripts_help.sh new file mode 100755 index 00000000..87b7cc85 --- /dev/null +++ b/dev/test_scripts_help.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +# +# Ensure each script can display help message to ensure basic execution. +# +# This script must be run from within the pipenv shell or a properly configured +# environment. +# +#### SETUP #################################################################### + +set -o errexit +set -o errtrace +set -o nounset + +# shellcheck disable=SC2154 +trap '_es=${?}; + printf "${0}: line ${LINENO}: \"${BASH_COMMAND}\""; + printf " exited with a status of ${_es}\n"; + exit ${_es}' ERR + +DIR_REPO="$(cd -P -- "${0%/*}/.." && pwd -P)" +EXIT_STATUS=0 + +#### FUNCTIONS ################################################################ + +test_help() { + local _es _script + for _script in $(find scripts/?-* -type f -name '*.py' | sort) + do + _es=0 + ./"${_script}" --help &>/dev/null || _es=${?} + if (( _es == 0 )) + then + echo "✅ ${_script}" + else + echo "❌ ${_script}" + EXIT_STATUS=${_es} + fi + done +} + +#### MAIN ##################################################################### + +cd "${DIR_REPO}" +test_help +exit ${EXIT_STATUS} From 8f5aca6f6599672359e4eab34a469c239df6bc52 Mon Sep 17 00:00:00 2001 From: Timid Robot Zehta Date: Fri, 7 Nov 2025 09:28:24 +0100 Subject: [PATCH 2/4] improve documentation and echo exit status --- dev/test_scripts_help.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dev/test_scripts_help.sh b/dev/test_scripts_help.sh index 87b7cc85..4dd90df4 100755 --- a/dev/test_scripts_help.sh +++ b/dev/test_scripts_help.sh @@ -3,7 +3,17 @@ # Ensure each script can display help message to ensure basic execution. # # This script must be run from within the pipenv shell or a properly configured -# environment. +# environment. For example: +# +# 1. Using pipenv run +# pipenv run ./dev/test_scripts_help.sh +# +# 2. Using pipenv shell +# pipenv shell +# ./dev/test_scripts_help.sh +# +# 3. A properly configured environment +# (see .github/workflows/test_scripts_help.yml) # #### SETUP #################################################################### @@ -42,4 +52,5 @@ test_help() { cd "${DIR_REPO}" test_help +echo "exit status: ${EXIT_STATUS}" exit ${EXIT_STATUS} From f0883db85d674eb630e7c224a257b2e3a33d68f4 Mon Sep 17 00:00:00 2001 From: Timid Robot Zehta Date: Fri, 7 Nov 2025 09:30:50 +0100 Subject: [PATCH 3/4] fix command name --- .github/workflows/test_scripts_help.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_scripts_help.yml b/.github/workflows/test_scripts_help.yml index 9d37f2b2..46675e3b 100644 --- a/.github/workflows/test_scripts_help.yml +++ b/.github/workflows/test_scripts_help.yml @@ -31,4 +31,4 @@ jobs: - name: test scripts' help run: | - ./dev/test_sripts_help.sh + ./dev/test_scripts_help.sh From e01fc182cd51e528b34607273361bda5bb0ceb05 Mon Sep 17 00:00:00 2001 From: Timid Robot Zehta Date: Fri, 7 Nov 2025 09:33:25 +0100 Subject: [PATCH 4/4] use Sentence case --- .github/workflows/test_scripts_help.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test_scripts_help.yml b/.github/workflows/test_scripts_help.yml index 46675e3b..ece0355f 100644 --- a/.github/workflows/test_scripts_help.yml +++ b/.github/workflows/test_scripts_help.yml @@ -29,6 +29,6 @@ jobs: run: | pipenv sync --system - - name: test scripts' help + - name: Test scripts' help run: | ./dev/test_scripts_help.sh