diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f3ce8c0..8115974b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,4 +21,8 @@ jobs: - name: Running examples shell: bash - run: echo "Hi!" \ No newline at end of file + run: python3 -m pip install KratosMultiphysics-all + + - name: Running examples + shell: bash + run: python3 ${GITHUB_WORKSPACE}/run_examples.py diff --git a/run_examples.py b/run_examples.py new file mode 100644 index 00000000..03da3082 --- /dev/null +++ b/run_examples.py @@ -0,0 +1,17 @@ +import os +import sys +import pathlib +import subprocess + +rootdir = "." +current = os.getcwd() + +for subdir, dirs, files in os.walk(rootdir): + for filename in files: + p = pathlib.PurePath(current, subdir, filename) + + if p.name == "MainKratos.py": + sp = subprocess.Popen([sys.executable, p], cwd=p.parents[0]) + x = sp.wait() + + print("Exit with code", x) \ No newline at end of file