diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a3be2bd73..98c2c47e4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -67,6 +67,9 @@ jobs: cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/docker.gyselalibxx_env/${{ matrix.toolchain }} .. cmake --build . -j 4 ctest -j 2 --timeout 5 --output-junit tests.xml + env: + OMPI_ALLOW_RUN_AS_ROOT: 1 # OpenMPI can run as root safely inside a docker container + OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 - name: Publish Test Report uses: mikepenz/action-junit-report@v4 if: success() || failure() # always run even if the previous step fails diff --git a/ci_tools/gyselalib_static_analysis.py b/ci_tools/gyselalib_static_analysis.py index eefb7bc74..0786e23fb 100644 --- a/ci_tools/gyselalib_static_analysis.py +++ b/ci_tools/gyselalib_static_analysis.py @@ -377,7 +377,8 @@ def check_directives(file): if file.file.suffix == '.hpp' and not file.root.findall("./dump/directivelist/directive[@str='#pragma once']"): report_error(FATAL, file, 2, "#pragma once missing from the top of a hpp file") - directives = {d.attrib['linenr']: d.attrib['str'].split() for d in file.root.findall("./dump/directivelist/directive")} + directives = {d.attrib['linenr']: d.attrib['str'].split() for d in file.root.findall("./dump/directivelist/directive") + if Path(d.attrib['file']) == file.file} include_directives = {linenr: words[1] for linenr, words in directives.items() if len(words)>1 and words[0] == '#include'} for linenr, include_str in include_directives.items(): include_file = include_str[1:-1] @@ -413,12 +414,16 @@ def check_licence_presence(file): for f in multipatch_geom: if no_file_filter or f in filter_files: print("------------- Checking ", f, " -------------") - subprocess.run([*cppcheck_command, f], check=False) + p = subprocess.run([*cppcheck_command, f], check=False) + if p.returncode: + error_level = max(error_level, possible_error_levels[STYLE]) for geom, files in relevant_files.items(): if no_file_filter or any(f in filter_files for f in files): print("------------- Checking ", geom, " -------------") - subprocess.run(cppcheck_command + list(files) + [f'--file-filter={f}' for f in filter_files], check=False) + p = subprocess.run(cppcheck_command + list(files) + [f'--file-filter={f}' for f in filter_files], check=False) + if p.returncode: + error_level = max(error_level, possible_error_levels[STYLE]) files = [FileObject(f) for f in HOME_DIR.glob('**/*.dump')] for myfile in files: