--- stages: - prepare - python - compile - setup - fortran - performance - deploy - update_master ################################################################################################### before_script: - ${LOCAL_HOME}/bin/manage_pool ${CI_JOB_ID} --nonblocking - source $DAMASKROOT/env/DAMASK.sh - export PATH=${BINDIR}:$PATH - cd $DAMASKROOT/PRIVATE/testing - echo Job start:" $(date)" after_script: - ${LOCAL_HOME}/bin/manage_pool ${CI_JOB_ID} --unregister - echo Job end:" $(date)" ################################################################################################### variables: # =============================================================================================== # GitLab Settings # =============================================================================================== GIT_SUBMODULE_STRATEGY: none # =============================================================================================== # Shortcut names # =============================================================================================== DAMASKROOT: "$LOCAL_HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID/DAMASK" TESTROOT: "$LOCAL_HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID/tests" BINDIR: "$LOCAL_HOME/GitLabCI_Pipeline_$CI_PIPELINE_ID/bin" # =============================================================================================== # Names of module files to load # =============================================================================================== # ++++++++++++ Compiler +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ IntelCompiler: "Compiler/Intel/19.1.2 Libraries/IMKL/2020" GNUCompiler: "Compiler/GNU/10" # ++++++++++++ MPI ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ MPI_Intel: "MPI/Intel/19.1.2/IntelMPI/2019" MPI_GNU: "MPI/GNU/10/OpenMPI/4.1.1" # ++++++++++++ PETSc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ PETSc_Intel: "Libraries/PETSc/3.16.1/Intel-19.1.2-IntelMPI-2019" PETSc_GNU: "Libraries/PETSc/3.16.1/GNU-10-OpenMPI-4.1.1" # ++++++++++++ MSC Marc +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ MSC: "FEM/MSC/2021.2" IntelMarc: "Compiler/Intel/19.1.2 Libraries/IMKL/2020" HDF5Marc: "HDF5/1.12.1/Intel-19.1.2" ################################################################################################### checkout: stage: prepare before_script: - ${LOCAL_HOME}/bin/manage_pool ${CI_JOB_ID} --nonblocking - echo Job start:" $(date)" script: - mkdir -p ${DAMASKROOT} - mkdir -p ${TESTROOT} - mkdir -p ${BINDIR} - cd ${DAMASKROOT} - git clone -q git@git.damask.mpie.de:damask/DAMASK.git . - git checkout ${CI_COMMIT_SHA} - git submodule update --init ################################################################################################### pytest: stage: python script: - cd ${DAMASKROOT}/python - pytest --basetemp ${TESTROOT}/python -v --cov --cov-report=term - coverage report --fail-under=90 mypy: stage: python script: - cd ${DAMASKROOT}/python - mypy -m damask ################################################################################################### compile_grid_Intel: stage: compile script: - module load $IntelCompiler $MPI_Intel $PETSc_Intel - cd pytest - pytest -k 'compile and grid' --basetemp ${TESTROOT}/compile_grid_Intel compile_mesh_Intel: stage: compile script: - module load $IntelCompiler $MPI_Intel $PETSc_Intel - cd pytest - pytest -k 'compile and mesh' --basetemp ${TESTROOT}/compile_mesh_Intel compile_grid_GNU: stage: compile script: - module load $GNUCompiler $MPI_GNU $PETSc_GNU - cd pytest - pytest -k 'compile and grid' --basetemp ${TESTROOT}/compile_grid_GNU compile_mesh_GNU: stage: compile script: - module load $GNUCompiler $MPI_GNU $PETSc_GNU - cd pytest - pytest -k 'compile and mesh' --basetemp ${TESTROOT}/compile_mesh_GNU compile_Marc: stage: compile script: - module load $IntelMarc $HDF5Marc $MSC - cd pytest - pytest -k 'compile and Marc' --basetemp ${TESTROOT}/compile_Marc ################################################################################################### setup_grid: stage: setup script: - module load $IntelCompiler $MPI_Intel $PETSc_Intel - cd $(mktemp -d) - cmake -DDAMASK_SOLVER=GRID -DCMAKE_INSTALL_PREFIX=${DAMASKROOT} ${DAMASKROOT} - make -j2 all install setup_mesh: stage: setup script: - module load $IntelCompiler $MPI_Intel $PETSc_Intel - cd $(mktemp -d) - cmake -DDAMASK_SOLVER=MESH -DCMAKE_INSTALL_PREFIX=${DAMASKROOT} ${DAMASKROOT} - make -j2 all install ################################################################################################### core: stage: fortran script: - module load $IntelCompiler $MPI_Intel $PETSc_Intel - cd pytest - pytest -k 'not compile' --basetemp ${TESTROOT}/fortran -v # Needs closer look # Phenopowerlaw_singleSlip: # stage: fortran # script: Phenopowerlaw_singleSlip/test.py ################################################################################################### grid_runtime: stage: performance script: - module load $IntelCompiler $MPI_Intel $PETSc_Intel - cd $DAMASKROOT - make clean grid OPTIMIZATION=AGGRESSIVE - REPO_DIR=$(mktemp -d) - git clone -q git@git.damask.mpie.de:damask/performance.git ${REPO_DIR} - cd ${DAMASKROOT}/PRIVATE/testing/ - ./runtime.py --input_dir $DAMASKROOT/examples/grid --output_dir ${REPO_DIR} --tag ${CI_COMMIT_SHA} - if [ ${CI_COMMIT_BRANCH} == development ]; then git commit -am ${CI_PIPELINE_ID}_${CI_COMMIT_SHA}; git push; fi resource_group: runtime before_script: - ${LOCAL_HOME}/bin/manage_pool ${CI_JOB_ID} --blocking ################################################################################################### source_distribution: stage: deploy script: - cd $(mktemp -d) - ${DAMASKROOT}/PRIVATE/releasing/tar.xz/create.sh ${DAMASKROOT} ${CI_COMMIT_SHA} ################################################################################################### merge_into_master: stage: update_master script: - cd ${DAMASKROOT} - export TESTEDREV=$(git describe) # might be detached from development branch - echo ${TESTEDREV} > python/damask/VERSION - git add python/damask/VERSION - > git diff-index --quiet HEAD || git commit -m "[skip ci] updated version information after successful test of $TESTEDREV" - export UPDATEDREV=$(git describe) # tested state + 1 commit - git checkout master - git pull - git merge $UPDATEDREV -s recursive -X ours # conflicts occur only for inconsistent state - git push origin master # master is now tested version and has updated VERSION file - git checkout development - git pull - git merge master -s recursive -X ours -m "[skip ci] Merge branch 'master' into development" # only possible conflict is in VERSION file - git push origin development # development is unchanged (as master is based on it) but has updated VERSION file only: - development