common.yml 5.92 KB
Newer Older
1
stages:
2
3
    - build_and_test
    - check_warnings
4
    - valgrind
5
    - analysis
6
    - generate_sonarqube
7

8

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

13
14
.build_template_linux: &build_template_linux
    stage: build_and_test
15
16
    except:
        - master
17
18
    image: registry.gitlab.inria.fr/morefem/thirdpartycompilationfactory/${OS}-${COMPILER}-${MODE}
    cache:
19
        key: "cache_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-${COMPILER}-${MODE}-${LIB_NATURE}-${IS_ONLY_ONE_LIB}"
20
21
22
23
        untracked: true
        paths:
            - build
    artifacts:
24
        name: "artifact_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-${COMPILER}-${MODE}-${LIB_NATURE}-${IS_ONLY_ONE_LIB}"
25
26
        expire_in: 2 days
        when: always
27
28
29
30
31
32
        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
33
        - ctest --output-on-failure
34
    after_script:
GILLES Sebastien's avatar
GILLES Sebastien committed
35
36
        # 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!
37
38
39
40
        - mv build/Sources/CMakeFiles Tmp
        - rm -rf build/Sources
        - mkdir -p build/Sources
        - mv Tmp build/Sources/CMakeFiles
41
42
43
44
45
46
        
        
.build_template_macos: &build_template_macos
    stage: build_and_test
    tags:
        - macos
47
48
    except:
        - master        
49
    cache:
50
        key: "cache_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-${COMPILER}-${MODE}-${LIB_NATURE}-${IS_ONLY_ONE_LIB}"
51
52
53
54
        untracked: true
        paths:
            - build
    artifacts:
55
        name: "artifact_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${OS}-${COMPILER}-${MODE}-${LIB_NATURE}-${IS_ONLY_ONE_LIB}"
56
57
        expire_in: 2 days
        when: always
58
59
60
61
        paths:
            - build/compilation.log
    script:
        - mkdir -p build
62
        - conda activate Python3
63
        - 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}
64
        - ninja 2>&1 | tee compilation.log
65
        - ctest --output-on-failure 
66
67
68
69
70
    
    
.run_doxygen_template: &run_doxygen_template
    stage: build_and_test
    image: ubuntu:latest
71
72
    except:
        - master
73
    artifacts:
74
        name: "artifact_run_doxygen_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${DOX}"
75
76
        expire_in: 1 day
        paths:
77
            - Documentation/Doxygen/${DOXYGEN_OUTPUT_FILE}
78
79
80
81
82
83
84
85
    before_script:
        - apt-get update -y
        - apt-get install -y doxygen graphviz libjs-mathjax

    script:
        - cd Documentation/Doxygen
        - doxygen ${DOX}
    
86
.check_compilation_warning_template_docker: &check_compilation_warning_template_docker
87
    stage: check_warnings
88
89
    except:
        - master
90
91
92
93
94
95
96
97
    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
    
98
99
100
101
102
103
104
105
106
.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    
    
107
108
    
.check_doxygen_warning_template: &check_doxygen_warning_template
109
    stage: check_warnings    
110
111
    except:
        - master    
112
113
    image: alpine:latest
    artifacts:
114
        name: "artifact_check_warning_doxygen_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${DOXYGEN_OUTPUT_FILE}"
115
116
117
118
119
120
121
122
        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:
123
124
125
        - ls
        - ls Documentation/Doxygen
        - ls Documentation/Doxygen/${DOXYGEN_OUTPUT_FILE}
126
127
128
        - python Scripts/Tools/find_warning_in_doxygen_log.py --log Documentation/Doxygen/${DOXYGEN_OUTPUT_FILE}
    allow_failure: true    
    
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167

doxygen_basic:
  <<: *run_doxygen_template
  variables:
      DOX: "basic_dev_guide.dox"
      DOXYGEN_OUTPUT_FILE: "basic.log"

doxygen_advanced:
  <<: *run_doxygen_template
  variables:
      DOX: "advanced_dev_guide.dox"
      DOXYGEN_OUTPUT_FILE: "advanced.log"

doxygen_complete:
  <<: *run_doxygen_template
  variables:
      DOX: "complete_dev_guide.dox"
      DOXYGEN_OUTPUT_FILE: "complete.log"

check_warning_doxygen_basic:
  <<: *check_doxygen_warning_template
  dependencies:
      - doxygen_basic
  variables:
      DOXYGEN_OUTPUT_FILE: "basic.log"

check_warning_doxygen_advanced:
  <<: *check_doxygen_warning_template
  dependencies:
      - doxygen_advanced
  variables:
      DOXYGEN_OUTPUT_FILE: "advanced.log"

check_warning_doxygen_complete:
  <<: *check_doxygen_warning_template
  dependencies:
      - doxygen_complete
  variables:
      DOXYGEN_OUTPUT_FILE: "complete.log"
168

169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190


# Pages doesn't work as invoked from a subgroup (not supported yet in gitlab)    
# pages:
#     stage: deploy
#     cache:
#       key: "$CI_COMMIT_REF_SLUG_doxygen"
#       untracked: true
#       paths:
#           - Documentation/Doxygen
#     before_script:
#         - mkdir -p public
#     tags:
#         - linux
#         - debug
#     script:
#         - cd Documentation/Doxygen
#         - mv Complete/* ../../public/
#     artifacts:
#         paths:
#           - public
    
191