diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd0b6be0849b..004b000515e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,6 +69,10 @@ jobs: # - name: Installing dependencies # => must be added to the docker container to avoid reinstalling it in every CI run + - name: CI configuration + shell: bash + run: python3 kratos/python_scripts/testing/ci_utilities.py + - name: Build shell: bash run: | @@ -172,6 +176,10 @@ jobs: with: python-version: '3.8' + - name: CI configuration + shell: bash + run: python3 kratos/python_scripts/testing/ci_utilities.py + - name: Download boost run: | $url = "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.gz" @@ -204,8 +212,11 @@ jobs: centos: runs-on: ubuntu-latest + needs: changed-files env: KRATOS_BUILD_TYPE: Custom + KRATOS_CI_CHANGED_FILES: ${{needs.changed-files.outputs.files}} + KRATOS_CI_APPLICATIONS: ".github/workflows/ci_apps_centos.json" container: image: kratosmultiphysics/kratos-image-ci-centos7:latest @@ -217,6 +228,10 @@ jobs: # - name: Installing dependencies # => must be added to the docker container to avoid reinstalling it in every CI run + - name: CI configuration + shell: bash + run: python3.8 kratos/python_scripts/testing/ci_utilities.py + - name: Build run: | export KRATOS_CMAKE_CXX_FLAGS="-Werror -Wno-deprecated-declarations -Wignored-qualifiers" @@ -232,8 +247,11 @@ jobs: ubuntu-core-without-unity: runs-on: ubuntu-latest + needs: changed-files env: KRATOS_BUILD_TYPE: Custom + KRATOS_CI_CHANGED_FILES: ${{needs.changed-files.outputs.files}} + KRATOS_CI_APPLICATIONS: "ONLY_CORE" OMPI_MCA_rmaps_base_oversubscribe: 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0) container: @@ -249,6 +267,10 @@ jobs: steps: - uses: actions/checkout@v4 + - name: CI configuration + shell: bash + run: python3 kratos/python_scripts/testing/ci_utilities.py + - name: Cache Build id: cache-build uses: actions/cache@v3 @@ -354,8 +376,11 @@ jobs: windows-core-without-unity: runs-on: windows-2022 + needs: changed-files env: KRATOS_BUILD_TYPE: Custom + KRATOS_CI_CHANGED_FILES: ${{needs.changed-files.outputs.files}} + KRATOS_CI_APPLICATIONS: "ONLY_CORE" steps: - uses: actions/checkout@v4 @@ -363,6 +388,10 @@ jobs: with: python-version: '3.8' + - name: CI configuration + shell: bash + run: python3 kratos/python_scripts/testing/ci_utilities.py + - name: Download boost run: | $url = "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.gz" @@ -515,8 +544,11 @@ jobs: ubuntu-intel: runs-on: ubuntu-latest + needs: changed-files env: KRATOS_BUILD_TYPE: Custom + KRATOS_CI_CHANGED_FILES: ${{needs.changed-files.outputs.files}} + KRATOS_CI_APPLICATIONS: ".github/workflows/ci_apps_intel.json" OMPI_MCA_rmaps_base_oversubscribe: 1 # Allow oversubscription for MPI (needed for OpenMPI >= 3.0) OMPI_MCA_btl_vader_single_copy_mechanism: none # suppressing some annoying OpenMPI messages @@ -530,6 +562,10 @@ jobs: # - name: Installing dependencies # => must be added to the docker container to avoid reinstalling it in every CI run + - name: CI configuration + shell: bash + run: python3 kratos/python_scripts/testing/ci_utilities.py + - name: Build shell: bash run: | diff --git a/.github/workflows/ci_apps_centos.json b/.github/workflows/ci_apps_centos.json new file mode 100644 index 000000000000..eade026fe027 --- /dev/null +++ b/.github/workflows/ci_apps_centos.json @@ -0,0 +1,9 @@ +[ + "FluidDynamicsApplication", + "MappingApplication", + "StructuralMechanicsApplication", + "MeshingApplication", + "LinearSolversApplication", + "ConstitutiveLawsApplication", + "CoSimulationApplication" +] \ No newline at end of file diff --git a/.github/workflows/ci_apps_intel.json b/.github/workflows/ci_apps_intel.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/.github/workflows/ci_apps_intel.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/kratos/python_scripts/testing/ci_utilities.py b/kratos/python_scripts/testing/ci_utilities.py index 4d8ada95ca37..ac30a2f30b9a 100644 --- a/kratos/python_scripts/testing/ci_utilities.py +++ b/kratos/python_scripts/testing/ci_utilities.py @@ -10,10 +10,15 @@ def check_valid_environment_configuration_exists() -> None: if not getenv("KRATOS_CI_CHANGED_FILES"): raise RuntimeError("Invalid CI-environment: KRATOS_CI_CHANGED_FILES") - if not getenv("KRATOS_CI_APPLICATIONS"): + kratos_ci_applications: Optional[str] = getenv("KRATOS_CI_APPLICATIONS") + + if kratos_ci_applications == "ONLY_CORE": + return + + if kratos_ci_applications is None: raise RuntimeError("Invalid CI-environment: KRATOS_CI_APPLICATIONS") - if not Path(getenv("KRATOS_CI_APPLICATIONS")).exists(): + if not Path(kratos_ci_applications).exists(): raise RuntimeError("Invalid CI-environment: KRATOS_CI_APPLICATIONS file does not exist") @@ -25,7 +30,13 @@ def changed_files() -> List[Path]: def ci_applications() -> List[str]: check_valid_environment_configuration_exists() - with open(getenv("KRATOS_CI_APPLICATIONS")) as ci_apps_file: + + kratos_ci_applications: str = getenv("KRATOS_CI_APPLICATIONS") + + if kratos_ci_applications == "ONLY_CORE": + return [] + + with open(kratos_ci_applications) as ci_apps_file: return json.load(ci_apps_file) @@ -51,13 +62,13 @@ def are_only_python_files_changed() -> bool: def print_ci_information() -> None: """This function prints an overview of the CI related information""" - pprint(f"{sorted(changed_files())=}") - pprint(f"{ci_applications()=}") - print(f"{get_changed_files_extensions()=}") + pprint(sorted(map(lambda p : p.as_posix(), changed_files()))) + pprint(sorted(ci_applications())) + print(f"{sorted(get_changed_files_extensions())=}") print(f"{are_only_python_files_changed()=}") - print(f"{get_changed_applications()=}") + print(f"{sorted(get_changed_applications())=}") print(f"{is_core_changed()=}") - print(f"{is_mpi_core_changed()=}") + print(f"{is_mpi_core_changed()=}\n") if __name__ == "__main__":