mirror of
https://github.com/AdaCore/OpenUxAS.git
synced 2026-02-12 13:07:16 -08:00
Recent updates to linters revealed a number of potential code-quality issues. Most were related to the use of f-strings in loggers, which is discouraged because the string interpolation is greedy (happens even if that logging level is disabled) and because it makes the job of log aggregators more difficult (unlikely to matter to us). There was an instance of use of a "global" that was not intended to be such. This was spotted by moving the core script-like functionality into a function, which avoided adding names to the global namespace. The script is also renamed to conform to python module-naming conventions. All warnings and errors are resolved, except the overly broad catching of Exception, which is explicitly silenced. Add a workflow for running the HelloWorld example in CI as a simple sanity check on run-example functionality.
19 lines
583 B
Bash
Executable File
19 lines
583 B
Bash
Executable File
#! /usr/bin/env bash
|
|
#
|
|
# run-example wrapper script.
|
|
|
|
# Script location
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
# Load global paths
|
|
source "${SCRIPT_DIR}/infrastructure/paths.sh"
|
|
|
|
# Activate the python venv
|
|
activate_venv
|
|
|
|
# Just in case, for uxas-ada. A bit ugly and special-purpose. Use build-env to
|
|
# avoid directly putting uxas-ada itself on the path (in case there's a local
|
|
# build)
|
|
debug_and_run "eval \"\$( \"${OPENUXAS_ROOT}/anod\" printenv uxas-ada --build-env )\""
|
|
debug_and_run "python3 \"${INFRASTRUCTURE_DIR}/run_example.py\" $*"
|