common.yml 4.59 KB
Newer Older
1
stages:
2 3
    - build_and_test
    - check_warnings
4
    - deploy
5
    - verrou
6
    - valgrind
7
    - analysis
8
    - generate_sonarqube
9

10

11 12 13 14
# As suggested by https://blog.sparksuite.com/7-ways-to-speed-up-gitlab-ci-cd-times-29f60aab69f9
variables:
  DOCKER_DRIVER: overlay2

15 16
.build_template_linux: &build_template_linux
    stage: build_and_test
17 18
    except:
        - master
19 20
    image: registry.gitlab.inria.fr/morefem/thirdpartycompilationfactory/${OS}-${COMPILER}-${MODE}
    cache:
21
        key: "cache_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-${COMPILER}-${MODE}-${LIB_NATURE}-${IS_ONLY_ONE_LIB}"
22 23 24 25
        untracked: true
        paths:
            - build
    artifacts:
26
        name: "artifact_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-${COMPILER}-${MODE}-${LIB_NATURE}-${IS_ONLY_ONE_LIB}"
27 28
        expire_in: 2 days
        when: always
29 30 31 32 33 34
        paths:
            - build/compilation.log
    script:
        - mkdir -p build
        - cd build && python ../cmake/Scripts/configure_cmake.py --cache_file=../cmake/PreCache/linux.cmake --cmake_args="-G Ninja"  --third_party_directory=/opt --mode=${MODE} --library_type=${LIB_NATURE}  --morefem_as_single_library=${IS_ONLY_ONE_LIB}
        - ninja |& tee compilation.log
35
        - ctest --output-on-failure
36
    after_script:
GILLES Sebastien's avatar
GILLES Sebastien committed
37 38
        # Remove the final targets that might be huge with static library, as cache creation could be beforehand
        # more than 80 % of the time spent on the job in the worst cases!
39 40 41 42
        - mv build/Sources/CMakeFiles Tmp
        - rm -rf build/Sources
        - mkdir -p build/Sources
        - mv Tmp build/Sources/CMakeFiles
43 44 45 46 47 48
        
        
.build_template_macos: &build_template_macos
    stage: build_and_test
    tags:
        - macos
49 50
    except:
        - master        
51
    cache:
52
        key: "cache_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-${COMPILER}-${MODE}-${LIB_NATURE}-${IS_ONLY_ONE_LIB}"
53 54 55 56
        untracked: true
        paths:
            - build
    artifacts:
57
        name: "artifact_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-${COMPILER}-${MODE}-${LIB_NATURE}-${IS_ONLY_ONE_LIB}"
58 59
        expire_in: 2 days
        when: always
60 61 62 63
        paths:
            - build/compilation.log
    script:
        - mkdir -p build
64
        - conda activate Python3
65
        - cd build && python ../cmake/Scripts/configure_cmake.py --cache_file=../cmake/PreCache/macos_apple_clang.cmake  --cmake_args="-G Ninja"  --third_party_directory=/Volumes/Data/ci/opt/clang_${MODE} --mode=${MODE} --library_type=${LIB_NATURE}  --morefem_as_single_library=${IS_ONLY_ONE_LIB}
66
        - ninja 2>&1 | tee compilation.log
67
        - ctest --output-on-failure 
68 69 70 71 72
    
    
.run_doxygen_template: &run_doxygen_template
    stage: build_and_test
    image: ubuntu:latest
73 74
    except:
        - master
75
    artifacts:
76
        name: "artifact_run_doxygen_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${DOX}"
77 78
        expire_in: 1 day
        paths:
79
            - Documentation/Doxygen/${DOXYGEN_OUTPUT_FILE}
80 81 82 83 84 85 86 87
    before_script:
        - apt-get update -y
        - apt-get install -y doxygen graphviz libjs-mathjax

    script:
        - cd Documentation/Doxygen
        - doxygen ${DOX}
    
88
.check_compilation_warning_template_docker: &check_compilation_warning_template_docker
89
    stage: check_warnings
90 91
    except:
        - master
92 93 94 95 96 97 98 99
    image: alpine:latest
    before_script:
        - apk add --update python python-dev && rm -rf /var/cache/apk/*
    # dependencies: in the instantiations!
    script:
        - python Scripts/Tools/find_warning_in_compilation_log.py --log build/compilation.log
    allow_failure: true
    
100 101 102 103 104 105 106 107 108
.check_compilation_warning_template_macos: &check_compilation_warning_template_macos
    stage: check_warnings
    except:
        - master
    # dependencies: in the instantiations!
    script:
        - python Scripts/Tools/find_warning_in_compilation_log.py --log build/compilation.log
    allow_failure: true    
    
109 110
    
.check_doxygen_warning_template: &check_doxygen_warning_template
111
    stage: check_warnings    
112 113
    except:
        - master    
114 115
    image: alpine:latest
    artifacts:
116
        name: "artifact_check_warning_doxygen_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${DOXYGEN_OUTPUT_FILE}"
117 118 119 120 121 122 123 124
        when: on_failure
        expire_in: 1 day
        paths:
            - filtered_doxygen_log.txt
    before_script:
        - apk add --update python python-dev && rm -rf /var/cache/apk/*
    # dependencies: in the instantiations!
    script:
125 126 127
        - ls
        - ls Documentation/Doxygen
        - ls Documentation/Doxygen/${DOXYGEN_OUTPUT_FILE}
128 129 130
        - python Scripts/Tools/find_warning_in_doxygen_log.py --log Documentation/Doxygen/${DOXYGEN_OUTPUT_FILE}
    allow_failure: true    
    
131

132