# CI pipeline configuration default: image: gmulas/np-tmcode # Switch from branch pipelines to merge request pipelines when a merge request is created workflow: rules: # Ensures next rules do not block triggered pipelines - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push" when: never # always run for merge requests - if: $CI_PIPELINE_SOURCE == "merge_request_event" # never run a branch pipeline if there is an open merge request for that branch - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS when: never # the only allowed branch pipeline is that on the default branch - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH stages: - build - run - test building_stage: stage: build tags: ["np-tmcode"] allow_failure: false artifacts: paths: - build/cluster/* - build/sphere/* - build/testing/* - build/trapping/* - doc/build/* exclude: - ".git*" - ".git/**/*" expire_in: 2 hours script: # bash commands to be executed - pwd - hostname - echo $CI_COMMIT_SHA - echo $CI_COMMIT_BRANCH - echo "Getting system info ..." - cat /etc/os-release - cd src - echo "Running make with default compilers..." - make wipe && make -j - echo "Running make with gnu compilers version 11..." - make wipe && CXX=g++-11 FC=gfortran-11 make -j - echo "Running make with gnu compilers version 12..." - make wipe && CXX=g++-12 FC=gfortran-12 make -j - echo "Running make with gnu fortran version 12 and clang version 13..." - make wipe && CXX="clang++-13 -stdlib=libc++" FC=gfortran-12 make -j - echo "Running make with gnu fortran version 12 and clang version 14..." - make wipe && CXX="clang++-14 -stdlib=libc++" FC=gfortran-12 make -j - echo "Running make with gnu fortran version 12 and clang version 15..." - make wipe && CXX="clang++-15 -stdlib=libc++" FC=gfortran-12 make -j - echo "Running make with gnu fortran version 12 and clang version 16..." - make wipe && CXX="clang++-16 -stdlib=libc++" FC=gfortran-12 make -j - make docs -j && make -C ../doc/build/latex -j running_stage: stage: run tags: ["np-tmcode"] allow_failure: false needs: - job: building_stage dependencies: - building_stage artifacts: paths: - build/cluster/c_* - build/sphere/c_* #- build/trapping/* exclude: - ".git*" - ".git/**/*" expire_in: 2 hours script: # bash commands to be executed - pwd - hostname - echo $CI_COMMIT_SHA - echo $CI_COMMIT_BRANCH - cd build/sphere - echo "Running np_sphere" - chmod +x np_sphere - ./np_sphere - cd ../cluster - echo "Running np_cluster" - chmod +x np_cluster - ./np_cluster testing_stage: stage: test tags: ["np-tmcode"] allow_failure: true needs: - job: building_stage - job: running_stage dependencies: - building_stage - running_stage artifacts: paths: - build/cluster/pycompare.html - build/sphere/pycompare.html exclude: - ".git*" - ".git/**/*" expire_in: 2 hours script: # bash commands to be executed - pwd - hostname - echo $CI_COMMIT_SHA - echo $CI_COMMIT_BRANCH - cd build/sphere - export FFILE=../../test_data/sphere/OSPH - echo "Comparing output of SPHERE" - python3 ../../src/scripts/pycompare.py --ffile=$FFILE --cfile=c_OSPH --html - cd ../cluster - echo "Comparing output of CLUSTER" - export FFILE=../../test_data/cluster/OCLU - python3 ../../src/scripts/pycompare.py --ffile=$FFILE --cfile=c_OCLU --html