common.yml 5.9 KB
Newer Older
1
stages:
2
3
    - build_and_test
    - check_warnings
4
    - analysis
5

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

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

    script:
        - cd Documentation/Doxygen
        - doxygen ${DOX}
    
83
.check_compilation_warning_template_docker: &check_compilation_warning_template_docker
84
    stage: check_warnings
85
86
    except:
        - master
87
88
89
90
91
92
93
94
    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
    
95
96
97
98
99
100
101
102
103
.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    
    
104
105
    
.check_doxygen_warning_template: &check_doxygen_warning_template
106
    stage: check_warnings    
107
108
    except:
        - master    
109
110
    image: alpine:latest
    artifacts:
111
        name: "artifact_check_warning_doxygen_${CI_PROJECT_ID}_${CI_COMMIT_REF_SLUG}_${DOXYGEN_OUTPUT_FILE}"
112
113
114
115
116
117
118
119
        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:
120
121
122
        - ls
        - ls Documentation/Doxygen
        - ls Documentation/Doxygen/${DOXYGEN_OUTPUT_FILE}
123
124
125
        - python Scripts/Tools/find_warning_in_doxygen_log.py --log Documentation/Doxygen/${DOXYGEN_OUTPUT_FILE}
    allow_failure: true    
    
126
    
127
doxygen_basic:
128
129
130
131
132
  <<: *run_doxygen_template
  variables:
      DOX: "basic_dev_guide.dox"
      DOXYGEN_OUTPUT_FILE: "basic.log"    

133
doxygen_advanced:
134
135
136
137
  <<: *run_doxygen_template
  variables:
      DOX: "advanced_dev_guide.dox"
      DOXYGEN_OUTPUT_FILE: "advanced.log"    
138

139
doxygen_complete:
140
141
142
  <<: *run_doxygen_template
  variables:
      DOX: "complete_dev_guide.dox"
143
      DOXYGEN_OUTPUT_FILE: "complete.log"
144
      
145
check_warning_doxygen_basic:
146
147
  <<: *check_doxygen_warning_template
  dependencies: 
148
      - doxygen_basic
149
150
151
  variables:
      DOXYGEN_OUTPUT_FILE: "basic.log"

152
check_warning_doxygen_advanced:
153
154
  <<: *check_doxygen_warning_template
  dependencies: 
155
      - doxygen_advanced
156
157
  variables:
      DOXYGEN_OUTPUT_FILE: "advanced.log"
158

159
check_warning_doxygen_complete:
160
161
  <<: *check_doxygen_warning_template
  dependencies: 
162
      - doxygen_complete
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
  variables:
      DOXYGEN_OUTPUT_FILE: "complete.log"
    


# 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
    
188