diff --git a/.ci-scripts/build-integration-test.yml b/.ci-scripts/build-integration-test.yml new file mode 100644 index 0000000000000000000000000000000000000000..66f38f76ec3ed929455f780ce14d998a613bdb7d --- /dev/null +++ b/.ci-scripts/build-integration-test.yml @@ -0,0 +1,85 @@ +# In contrast to testFramework, we don't need a clean repo folder as the unicado repository +# folder is the equivalent +build-integration-test: + stage: build + tags: + - INTEGRATION-TEST + needs: + - setup-integration-test + cache: + when: always + paths: + - ${CI_PROJECT_DIR} + script: + - export NAME_MODIFIED_TOOL=$(cat NAME_MODIFIED_TOOL.env) + - export DEBIAN_FRONTEND="noninteractive" + + - | + apt-get update -qq && DEBIAN_FRONTEND="noninteractive" apt-get install -y -qq --no-install-recommends apt-utils && \ + apt-get install -y -qq --no-install-recommends git build-essential cmake python3 python3-dev libeigen3-dev \ + libcgal-dev libgmp-dev libmpfr-dev libboost-all-dev python3-pip > /dev/null + - pip3 install pipenv --break-system-packages > /dev/null + - pipenv --python /usr/bin/python3 install > /dev/null + + ## Make gnuplot and inkscape executable + - chmod +x ${PATH_CLEAN_ADDITIONAL_SOFTWARE}/${DIR_GNUPLOT}/gnuplot + - chmod +x ${PATH_CLEAN_ADDITIONAL_SOFTWARE}/${DIR_INKSCAPE}/inkscape + + ## Modify CMakeLists.txt to only configure modified tool + - cd ${DIR_UNICADO}/aircraftDesign + - cp ${CI_PROJECT_DIR}/.ci-scripts/utils/modify_CMakeLists_to_configure_only.py . + - python3 modify_CMakeLists_to_configure_only.py "${NAME_MODIFIED_TOOL}" + + ## "Build former called clean repo - now within UNICADO" + - cmake -B build -S . --preset x64-linux-release --fresh # -DFIND_LIBRARIES_AS_PACKAGE=ON -DCMAKE_PREFIX_PATH=../libs >/dev/null + - cmake --build --preset x64-linux-release --target ${NAME_MODIFIED_TOOL} -j4 # Assume 4 cores + - cd ${CI_PROJECT_DIR}/${DIR_UNICADO} + + ## Modify CMakeLists.txt to only configure ${DIR_DESIGN_EVALUATOR} + - cd additionalSoftware + - cp ${CI_PROJECT_DIR}/.ci-scripts/utils/modify_CMakeLists_to_configure_only.py . + - python3 modify_CMakeLists_to_configure_only.py "${DIR_DESIGN_EVALUATOR}" + + ## "Build ${DIR_DESIGN_EVALUATOR} in unicado repo" + - cmake -B build -S . --preset x64-linux-release --fresh + - cmake --build --preset x64-linux-release --target ${DIR_DESIGN_EVALUATOR} -j4 + - cd ${CI_PROJECT_DIR}/${DIR_UNICADO} + + ## Create project and copy gnuplot and linux into AD repo of UNICADO (Clean repo) if not existent + - cd ${PATH_CLEAN_AIRCRAFT_DESIGN} + - | + if [ ! -d "${DIR_PROJECTS}" ]; then + mkdir ${DIR_PROJECTS} && cd ${DIR_PROJECTS}/ && mkdir ${NAME_AIRCRAFT_TYPE} && cd ${NAME_AIRCRAFT_TYPE} && mkdir ${NAME_AIRCRAFT_VERSION} && cd ${PATH_CLEAN_AIRCRAFT_DESIGN} + cp -rf ${PATH_CLEAN_AIRCRAFT_REFERENCES}/${NAME_AIRCRAFT_TYPE}/${NAME_AIRCRAFT_VERSION}/cleanSheetDesign/* ${PATH_CLEAN_IO_DIR} + fi + - if [ ! -d "${DIR_GNUPLOT}" ]; then cp -rf ${PATH_CLEAN_ADDITIONAL_SOFTWARE}/${DIR_GNUPLOT} .; fi + - if [ ! -d "${DIR_INKSCAPE}" ]; then cp -rf ${PATH_CLEAN_ADDITIONAL_SOFTWARE}/${DIR_INKSCAPE} .; fi + - if [ ! -d "${DIR_DESIGN_EVALUATOR}" ]; then cp -rf ${PATH_CLEAN_ADDITIONAL_SOFTWARE}/${DIR_DESIGN_EVALUATOR} .; fi + + ## Modify CMakeLists.txt to only configure modified tool + - cd ${CI_PROJECT_DIR} + - cp .ci-scripts/utils/modify_CMakeLists_to_configure_only.py . + - python3 modify_CMakeLists_to_configure_only.py "${NAME_MODIFIED_TOOL}" + + ## Same game for so called "local" repo + - cmake -B build -S . --preset x64-linux-release --fresh + - cmake --build --preset x64-linux-release --target ${NAME_MODIFIED_TOOL} -j4 + + ## "Copy built ${DIR_DESIGN_EVALUATOR} from unicado repo to local repo" + - if [ ! -d "${DIR_DESIGN_EVALUATOR}" ]; then cp -rf ${PATH_CLEAN_ADDITIONAL_SOFTWARE}/${DIR_DESIGN_EVALUATOR} .; fi + + ## Create ${DIR_PROJECTS} folder and copy aircraft reference design + - | + if [ ! -d "${DIR_PROJECTS}" ]; then + mkdir ${DIR_PROJECTS} && cd ${DIR_PROJECTS}/ && mkdir ${NAME_AIRCRAFT_TYPE} && cd ${NAME_AIRCRAFT_TYPE} && mkdir ${NAME_AIRCRAFT_VERSION} && cd ${CI_PROJECT_DIR} + cp -rf ${PATH_CLEAN_AIRCRAFT_REFERENCES}/${NAME_AIRCRAFT_TYPE}/${NAME_AIRCRAFT_VERSION}/cleanSheetDesign/* ${PATH_LOCAL_IO_DIR} + fi + + ## "Copy gnuplot and inkscape" + - if [ ! -d "${DIR_GNUPLOT}" ]; then cp -rf ${PATH_CLEAN_ADDITIONAL_SOFTWARE}/${DIR_GNUPLOT} .; fi + - if [ ! -d "${DIR_INKSCAPE}" ]; then cp -rf ${PATH_CLEAN_ADDITIONAL_SOFTWARE}/${DIR_INKSCAPE} .; fi + + ## Clean up git repositories. This will hopefully reduce the cache size significantly. + - cd ${CI_PROJECT_DIR} + - if [ -d ".git" ]; then rm -rf .git; fi + - if [ -d "build" ]; then rm -rf build; fi \ No newline at end of file diff --git a/.gitignore b/.gitignore index f00052f1f113ce3c7636405e0d79a5afd777914b..f0c5d053225df16d99232721cd4da857b09b9122 100644 --- a/.gitignore +++ b/.gitignore @@ -65,7 +65,6 @@ __pycache__ # Build directories build -build* # CMake user files CMakeUserPresets.json