forked from SGL-UT/gnsstk-apps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
executable file
·1336 lines (1261 loc) · 37.8 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#.yml file for Gitlab-CI support
# Note that the following tokens must be supplied via the Gitlab Repository Settings:
# - CI_USER: username to pull from gitlab repository in sgl-tks group
# - CI_TOKEN: password to pull from gitlab repository in sgl-tks group
# - PACKAGE_CONFIG_1/2 to pull from project settings cicd variables
# - PACKAGE_CONFIG_CONDA_1/2 to pull from project settings cicd variables
# - DOCKER_REGISTRY to pull from project settings cicd variables
include:
- project: sgl-tks/ci-control
file: /gnsstk-apps/ci_downstrm_chain.yml
ref: main
- project: sgl-tks/ci-control
file: /general/artifactory-upload.yml
ref: main
- project: 'sgl/ci-control'
file: 'common/scanning/sonar.yml'
stages:
- check
- build
- test
- quality
- install
- package
- push
- deploy
- downstream_stack
- experiment
variables:
# Default cmake arguments
CMAKE_ARG_DEFAULT: "-DBUILD_EXT=ON -DTEST_SWITCH=ON ../"
GNSSTK_COMMIT:
value: "main"
description: "Upstream gnsstk lib branch to link. Defaults to main"
# By default, pipeline will build with both VS 2015 and VS 2019 windows jobs along with rest of platform jobs.
# If you want to build only VS 2019 windows jobs, then set BLD_ONLY_VS2019 to True. It will exclude rest of platform jobs.
# If you want to exclude VS 2019 windows jobs, then set BLD_VS2019 to False.
BLD_VS2019:
value: "True"
description: "If True, then build under Windows using Visual Studio 2019. Defaults to True"
BLD_ONLY_VS2019:
value: "False"
description: "If True, then ONLY build Windows using Visual Studio 2019 and skips Visual Studio 2015 jobs. Defaults to False"
BLD_VS_DLL:
value: "True"
description: "If True, then link against Dynamic Link Libraries (VS2019 only)"
BLD_VS_STATIC:
value: "True"
description: "If True, then link against Static Libraries (VS2019 only, VS2015 always builds static)"
# Sonar Controls
SONAR_EXCLUSIONS: '**/tests/**,**/rpm_files/**,**/conda_recipe/**,**/data/**,**/coverage-cpp.xml,**/build*/**,**/debian/**,**/deprecated/**,**/examples/**,**/ref/**,**/rpm_files/**,**/swig/**,**/DoxygenLayout.xml,**/custom.css'
SONAR_SOURCES: 'core'
SONAR_TEST_SOURCES: 'core/tests'
SONAR_TEST_INCLUSION: 'core/tests'
SONAR_PROJECT_KEY: gnsstk-apps
SONAR_ADDTIONAL_PARAMS: "-Dsonar.cfamily.gcov.reportsPath=."
# Template for all normal jobs.
.normal_job:
except:
variables:
- $BLD_ONLY_VS2019 == "True"
.vs2019_job:
only:
variables:
- $BLD_VS2019 == "True"
- $BLD_VS_STATIC == "True"
.vs2019_dll_job:
only:
variables:
- $BLD_VS2019 == "True"
- $BLD_VS_DLL == "True"
# Template for all jobs that should deploy packages.
.package_deploy:
only:
refs:
- main
- /^ci_.*$/
- /^version_.*_prep$/
- tags
- /^tag_.*$/
- stable
- /^release\/v[0-9.]*$/
- /^bugfix/ci_*$/
- /^feature/ci_*$/
variables:
- $BLD_ONLY_VS2019 != "True"
.build_conda:
stage: build
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/tks/centos-conda:python-3.6
before_script:
- source /opt/miniconda/etc/profile.d/conda.sh
script:
# Install dependencies from latest CI first. Some packages are python version dependent, others are not.
# Using python 3.9 for build and testing is arbitrary since gnsstk-apps is not python dependent.
- bash conda_recipe/get_required_deps_conda.sh package_conda ${PKG_TYPE}
- 'bash conda_recipe/get_required_deps_conda.sh "package_conda: [3.9]" ${PKG_TYPE}'
- conda create -c file://$PWD/conda-deps --name py3.9 "python=3.9" gnsstk ${OPT_CONDA_LIBS}
- conda activate py3.9
# Link optional libraries
- ./optional_package_add.sh ${OPT_LIBS}
- mkdir -p build
- cd build
- export gnsstk=`pwd`/install
- cmake -DPYTHON_INSTALL_PREFIX=$gnsstk -DCMAKE_INSTALL_PREFIX=install $CMAKE_ARG_DEFAULT
- make all -j 4
artifacts:
paths:
- build/
# Check Stage
# Runs static analysis on code.
static_analysis:
stage: check
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild
script:
- ./lint_test.sh
# Allow failures here to prevent blocking the rest of the pipeline.
allow_failure: true
submodule_check:
stage: check
needs: []
extends: .normal_job
tags:
- docker-executor
variables:
GIT_SUBMODULE_UPDATE_FLAGS: --remote
only:
- main
image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild
script:
- (! git status --porcelain | grep 'M data')
# sgl_lint will verify that source files have proper copyright.
sgllint_lint:
stage: check
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-10:python3
script:
- '######'
- '# This job checks all files for required lines like copyright/license statements.'
- '######'
# Obtain the latest version of ./sgl_lint.py
- python3 -m pip install sgl-ci-tools
- sgl_lint -v -R core
- sgl_lint -v -R ext
- sgl_lint -v -R swig/apps
- sgl_lint -v -R swig/gnsstk
dependencies: []
protected_term_lint:
stage: check
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-10:python3
script:
- '######'
- '# This job checks all files for protected terms in files modified since the branch split from default.'
- '######'
- apt-get update && apt-get install -y git
- python3 -m pip install tks-ci-tools
# We pull the default branch because the CI doesn't normally have any branches other than the one being tested.
- echo "git fetch -uf origin ${CI_DEFAULT_BRANCH}:${CI_DEFAULT_BRANCH}"
- git fetch -uf origin ${CI_DEFAULT_BRANCH}:${CI_DEFAULT_BRANCH}
- echo "modified_file_check.sh ${CI_DEFAULT_BRANCH} $CI_COMMIT_SHA"
- modified_file_check.sh ${CI_DEFAULT_BRANCH} $CI_COMMIT_SHA
dependencies: []
# This has the occasional false-positive, so it's advisory only.
allow_failure: true
protected_history_lint:
stage: check
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-10:python3
script:
- '######'
- '# This job checks all files modified on this branch for sensitive terms.'
- '######'
- apt-get update && apt-get install -y git
- python3 -m pip install tks-ci-tools
# We pull the default branch because the CI doesn't normally have any branches other than the one being tested.
- echo "git fetch -uf origin ${CI_DEFAULT_BRANCH}:${CI_DEFAULT_BRANCH}"
- git fetch -uf origin ${CI_DEFAULT_BRANCH}:${CI_DEFAULT_BRANCH}
- echo "history_check.sh ${CI_DEFAULT_BRANCH} $CI_COMMIT_SHA"
- history_check.sh ${CI_DEFAULT_BRANCH} $CI_COMMIT_SHA
dependencies: []
# This has the occasional false-positive, so it's advisory only.
allow_failure: true
# Runs the documentation generation
generate_documentation:
stage: check
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild
script:
# Install GraphViz
- sudo apt-get install -y graphviz
# Call doxygen w/alternate target directory
- doxygen
# Allow failures here to prevent blocking the rest of the pipeline.
allow_failure: true
artifacts:
paths:
- docs/
# Validates some internal repository structure.
repository_validation:
stage: check
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild
script:
# Verify there are no duplicate header files names in the repo.
- ./dup_check.sh
# Allow failures here to prevent blocking the rest of the pipeline.
allow_failure: false
#
# Build Stage - Try building in several environments.
#
deb10_build:
stage: build
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild
script:
# Install dependencies from latest CI first.
- bash debian/install_required_deps_debian.sh package_debian_10 pkg_min
- mkdir -p build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=install -DPYTHON_EXECUTABLE=/usr/bin/python3 $CMAKE_ARG_DEFAULT
- make all -j 4
artifacts:
paths:
- build/
deb10_op1_build:
stage: build
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild
script:
# Install dependencies from latest CI first.
- bash debian/install_required_deps_debian.sh package_debian_10 pkg_max
# Link optional library
- ./optional_package_add.sh $PACKAGE_CONFIG_1
- mkdir -p build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=install -DPYTHON_EXECUTABLE=/usr/bin/python3 $CMAKE_ARG_DEFAULT
- make all -j 4
artifacts:
paths:
- build/
deb10_op2_build:
stage: build
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild
script:
# Install dependencies from latest CI first.
- bash debian/install_required_deps_debian.sh package_debian_10 pkg_max
# Link optional libraries
- ./optional_package_add.sh $PACKAGE_CONFIG_2
- mkdir -p build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=install -DPYTHON_EXECUTABLE=/usr/bin/python3 $CMAKE_ARG_DEFAULT
- make all -j 4
artifacts:
paths:
- build/
deb11_build:
stage: build
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild
script:
# Install dependencies from latest CI first.
- bash debian/install_required_deps_debian.sh package_debian_11 pkg_min
- mkdir -p build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=install $CMAKE_ARG_DEFAULT
- make all -j 4
artifacts:
paths:
- build/
deb11_op1_build:
stage: build
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild
script:
# Install dependencies from latest CI first.
- bash debian/install_required_deps_debian.sh package_debian_11 pkg_max
# Link optional libraries
- ./optional_package_add.sh $PACKAGE_CONFIG_1
- mkdir -p build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=install $CMAKE_ARG_DEFAULT
- make all -j 4
artifacts:
paths:
- build/
deb11_op2_build:
stage: build
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild
script:
# Install dependencies from latest CI first.
- apt-get install -y libhdf5-dev
- bash debian/install_required_deps_debian.sh package_debian_11 pkg_max
# Link optional libraries
- ./optional_package_add.sh $PACKAGE_CONFIG_2
- mkdir -p build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=install $CMAKE_ARG_DEFAULT
- make all -j 4
artifacts:
paths:
- build/
ubu20_build:
stage: build
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/ubuntu-20.04:pkgbuild
script:
# Install dependencies from latest CI first.
- bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min
- mkdir -p build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=install -DPYTHON_EXECUTABLE=/usr/bin/python3 $CMAKE_ARG_DEFAULT
- make all -j 4
artifacts:
paths:
- build/
conda_build:
variables:
OPT_LIBS: ""
OPT_CONDA_LIBS: ""
PKG_TYPE: "pkg_min"
extends: .build_conda
conda_op2_build:
variables:
OPT_LIBS: $PACKAGE_CONFIG_2
OPT_CONDA_LIBS: $PACKAGE_CONFIG_CONDA_2
PKG_TYPE: "pkg_max"
extends: .build_conda
rhel8_build:
stage: build
needs: []
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/centos-8:pkgbuild
script:
# Install dependencies from latest CI first.
- bash rpm_files/install_required_deps_rpm.sh package_redhat_8 pkg_min
- mkdir -p build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=install $CMAKE_ARG_DEFAULT
- make all -j 4
artifacts:
paths:
- build/
windows_build:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/$CI_PIPELINE_ID
stage: build
needs: []
extends: .normal_job
tags:
- win10-vs2015
script:
- windows/install_required_deps_windows.ps1 user_install_windows pkg_min
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- mkdir build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=install -DBUILD_EXT=ON -DTEST_SWITCH=ON -G "Visual Studio 14 2015 Win64" ../
- cmake --build . --config Release -- /m
artifacts:
paths:
- build/
windows_build_vs2019:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/${CI_PIPELINE_ID}_vs2019
stage: build
needs: []
extends: .vs2019_job
tags:
- win10-vs2019
script:
- windows/install_required_deps_windows.ps1 user_install_windows_vs2019 pkg_min
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- mkdir build
- cd build
- cmake -DBUILD_SHARED_LIBS=FALSE -DCMAKE_INSTALL_PREFIX=install -DBUILD_EXT=ON -DTEST_SWITCH=ON -G "Visual Studio 16 2019" -A x64 ../
- cmake --build . --config Release -- /m
artifacts:
paths:
- build/
allow_failure: false
windows_build_vs2019_dll:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/${CI_PIPELINE_ID}_vs2019_dll
stage: build
needs: []
extends: .vs2019_dll_job
tags:
- win10-vs2019
script:
- windows/install_required_deps_windows.ps1 user_install_windows_vs2019_dll pkg_min
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- mkdir build
- cd build
- cmake -DBUILD_SHARED_LIBS=TRUE -DCMAKE_INSTALL_PREFIX=install -DBUILD_EXT=ON -DTEST_SWITCH=ON -G "Visual Studio 16 2019" -A x64 ../
- cmake --build . --config Release -- /m
artifacts:
paths:
- build/
allow_failure: false
windows_op1_build_vs2019:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/${CI_PIPELINE_ID}_vs2019_op1
stage: build
needs: []
extends: .vs2019_job
tags:
- win10-vs2019
script:
- $linkfile=".\ExtLinkage.cmake"
- $str1="find_package("
- $str2=$env:PACKAGE_CONFIG_1.ToUpper()
- $str3=" CONFIG)"
- if (Test-Path $linkfile) { Remove-Item $linkfile }
- foreach ($pkg in $str2) { "$str1$pkg$str3" | Out-File -FilePath $linkfile -Append -Encoding UTF8 }
- type $linkfile
- windows/install_required_deps_windows.ps1 user_install_windows_vs2019 pkg_max
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- mkdir build
- cd build
- cmake -DBUILD_SHARED_LIBS=FALSE -DCMAKE_INSTALL_PREFIX=install -DBUILD_EXT=ON -DTEST_SWITCH=ON -G "Visual Studio 16 2019" -A x64 ../
- cmake --build . --config Release -- /m
artifacts:
paths:
- build/
allow_failure: false
windows_op1_build_vs2019_dll:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/${CI_PIPELINE_ID}_vs2019_dll_op1
stage: build
needs: []
extends: .vs2019_dll_job
tags:
- win10-vs2019
script:
- $linkfile=".\ExtLinkage.cmake"
- $str1="find_package("
- $str2=$env:PACKAGE_CONFIG_1.ToUpper()
- $str3=" CONFIG)"
- if (Test-Path $linkfile) { Remove-Item $linkfile }
- foreach ($pkg in $str2) { "$str1$pkg$str3" | Out-File -FilePath $linkfile -Append -Encoding UTF8 }
- type $linkfile
- windows/install_required_deps_windows.ps1 user_install_windows_vs2019_dll pkg_max
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- mkdir build
- cd build
- cmake -DBUILD_SHARED_LIBS=TRUE -DCMAKE_INSTALL_PREFIX=install -DBUILD_EXT=ON -DTEST_SWITCH=ON -G "Visual Studio 16 2019" -A x64 ../
- cmake --build . --config Release -- /m
artifacts:
paths:
- build/
allow_failure: false
.test_conda:
stage: test
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/tks/centos-conda:python-3.6
before_script:
- source /opt/miniconda/etc/profile.d/conda.sh
script:
# Install dependencies from latest CI first. Some dependencies are python version dependent, others are not.
- bash conda_recipe/get_required_deps_conda.sh package_conda ${PKG_TYPE}
- 'bash conda_recipe/get_required_deps_conda.sh "package_conda: [3.9]" ${PKG_TYPE}'
- conda create -c file://$PWD/conda-deps/ --name py3.9 python=3.9 gnsstk $OPT_CONDA_LIBS
- conda activate py3.9
- python -c "import gnsstk"
- cd build
- ctest -j 4
- touch $CI_PROJECT_DIR/success
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
- build/swig/
expire_in: 4 days
conda_test:
extends: .test_conda
dependencies: [conda_build]
needs: [conda_build]
variables:
OPT_LIBS: ""
OPT_CONDA_LIBS: ""
PKG_TYPE: "pkg_min"
conda_op2_test:
extends: .test_conda
dependencies: [conda_op2_build]
needs: [conda_op2_build]
variables:
OPT_LIBS: $PACKAGE_CONFIG_2
OPT_CONDA_LIBS: $PACKAGE_CONFIG_CONDA_2
PKG_TYPE: "pkg_max"
deb10_test:
stage: test
needs: [deb10_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild
script:
- bash debian/install_required_deps_debian.sh package_debian_10 pkg_min
- cd build
- ctest -j 4
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
dependencies:
- deb10_build
deb10_op2_test:
stage: test
needs: [deb10_op2_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-10:pkgbuild
script:
- bash debian/install_required_deps_debian.sh package_debian_10 pkg_max
- cd build
- ctest -j 4
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
dependencies:
- deb10_op2_build
deb11_test:
stage: test
needs: [deb11_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild
script:
- bash debian/install_required_deps_debian.sh package_debian_11 pkg_min
- cd build
- ctest -j 4
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
dependencies:
- deb11_build
deb11_op2_test:
stage: test
needs: [deb11_op2_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild
script:
- bash debian/install_required_deps_debian.sh package_debian_11 pkg_max
- cd build
- ctest -j 4
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
dependencies:
- deb11_op2_build
ubu20_test:
stage: test
needs: [ubu20_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/ubuntu-20.04:pkgbuild
script:
- bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min
- cd build
- ctest -j 4
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
dependencies:
- ubu20_build
rhel8_test:
stage: test
needs: [rhel8_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/centos-8:pkgbuild
script:
- bash rpm_files/install_required_deps_rpm.sh package_redhat_8 pkg_min
- cd build
- ctest -j 4
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
dependencies:
- rhel8_build
windows_test:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/$CI_PIPELINE_ID
GIT_STRATEGY: none
stage: test
needs: [windows_build]
extends: .normal_job
tags:
- win10-vs2015
script:
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- cd build
- cmake --build . --target RUN_TESTS --config Release
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
dependencies:
- windows_build
timeout: 10m
allow_failure: false
windows_test_vs2019:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/${CI_PIPELINE_ID}_vs2019
GIT_STRATEGY: none
stage: test
needs: [windows_build_vs2019]
extends: .vs2019_job
tags:
- win10-vs2019
script:
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- cd build
- cmake --build . --target RUN_TESTS --config Release
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
dependencies:
- windows_build_vs2019
timeout: 10m
allow_failure: false
windows_test_vs2019_dll:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/${CI_PIPELINE_ID}_vs2019_dll
GIT_STRATEGY: none
stage: test
needs: [windows_build_vs2019_dll]
extends: .vs2019_dll_job
tags:
- win10-vs2019
script:
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- cd build
- cmake --build . --target RUN_TESTS --config Release
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
dependencies:
- windows_build_vs2019_dll
timeout: 10m
allow_failure: false
windows_op1_test_vs2019:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/${CI_PIPELINE_ID}_vs2019_op1
GIT_STRATEGY: none
stage: test
needs: [windows_op1_build_vs2019]
extends: .vs2019_job
tags:
- win10-vs2019
script:
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- cd build
- cmake --build . --target RUN_TESTS --config Release
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
dependencies:
- windows_op1_build_vs2019
timeout: 10m
allow_failure: false
windows_op1_test_vs2019_dll:
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/${CI_PIPELINE_ID}_vs2019_dll_op1
GIT_STRATEGY: none
stage: test
needs: [windows_op1_build_vs2019_dll]
extends: .vs2019_dll_job
tags:
- win10-vs2019
script:
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- cd build
- cmake --build . --target RUN_TESTS --config Release
artifacts:
when: on_failure
paths:
- build/Testing/Temporary/
dependencies:
- windows_op1_build_vs2019_dll
timeout: 10m
allow_failure: false
#
# Quality Stage - SonarQube code quality scan
#
sonar-scan:
image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild
stage: quality
needs: []
extends:
- .sonarqube-check
tags:
- docker-executor
script:
- apt-get install gcovr lcov -y
- bash debian/install_required_deps_debian.sh package_debian_11 pkg_min
- mkdir build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=install -DDEBUG_SWITCH=ON -DTEST_SWITCH=ON -DCOVERAGE_SWITCH=ON ../
- build-wrapper-linux-x86-64 --out-dir . make all -j 4
- ctest -j 4
- cd ..
- gcovr --exclude=build* --xml-pretty --exclude-unreachable-branches --print-summary -o coverage-cpp.xml -r .
- for f in `find . -name '*.o'`; do echo "Processing $f file..."; pushd `dirname $f`; gcov -o `basename $f` x; popd ;done
- !reference [.scan-c++, script]
- touch $CI_PROJECT_DIR/success
rules:
- if: $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_REF_NAME == "stable"
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: manual
# Sonar Quality Profile will fail since code coverage is below 80%
# Allowing job to fail so sonar scan doesn't fail the pipeline for nightly big chain.
allow_failure: true
# only:
# - merge_requests
# - main
# - tags
# - stable
# User_Install Stage
# Tests user install of GNSSTk on each platform, saves artifacts for
# downstream builds.
deb11_user_install:
stage: install
needs: [deb11_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild
script:
- bash debian/install_required_deps_debian.sh package_debian_11 pkg_min
- cd build
- export gnsstk=`pwd`/install
- cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../
- make install -j 4
artifacts:
paths:
- build/install
dependencies:
- deb11_build
ubu20_user_install:
stage: install
needs: [ubu20_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/ubuntu-20.04:pkgbuild
script:
- bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min
- cd build
- export gnsstk=`pwd`/install
- cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../
- make install -j 4
artifacts:
paths:
- build/install
dependencies:
- ubu20_build
rhel8_user_install:
stage: install
needs: [rhel8_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/centos-8:pkgbuild
script:
- bash rpm_files/install_required_deps_rpm.sh package_redhat_8 pkg_min
- cd build
- export gnsstk=`pwd`/install
- cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../
- make install -j 4
artifacts:
paths:
- build/install
dependencies:
- rhel8_build
user_install_windows:
stage: install
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/$CI_PIPELINE_ID
GIT_STRATEGY: none
needs: [windows_build,windows_test]
extends: .normal_job
tags:
- win10-vs2015
script:
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- cd build
- cmake --build . --config Release --target install
artifacts:
paths:
- build/install/
dependencies:
- windows_build
- windows_test
timeout: 20m
allow_failure: false
user_install_windows_vs2019:
stage: install
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/${CI_PIPELINE_ID}_vs2019
GIT_STRATEGY: none
needs: [windows_build_vs2019,windows_test_vs2019]
extends: .vs2019_job
tags:
- win10-vs2019
script:
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- cd build
- cmake --build . --config Release --target install
artifacts:
paths:
- build/install/
dependencies:
- windows_build_vs2019
- windows_test_vs2019
timeout: 20m
allow_failure: false
user_install_windows_vs2019_dll:
stage: install
variables:
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_NAME/${CI_PIPELINE_ID}_vs2019_dll
GIT_STRATEGY: none
needs: [windows_build_vs2019_dll,windows_test_vs2019_dll]
extends: .vs2019_dll_job
tags:
- win10-vs2019
script:
- Get-ChildItem "$env:CI_PROJECT_DIR\library\build\install\share\cmake" -Directory | Foreach-Object { $env:CMAKE_PREFIX_PATH += ";" + $_.FullName }
- cd build
- cmake --build . --config Release --target install
artifacts:
paths:
- build/install/
dependencies:
- windows_build_vs2019_dll
- windows_test_vs2019_dll
timeout: 20m
allow_failure: false
# user_install_windows_op1_vs2019: Moved to sgl-tks/ci-control/gnsstk-apps/ci_downstrm_chain.yml
# System Stage
# Tests install of GNSSTk on each platform, saves artifacts for downstream builds.
deb11_system_install:
stage: install
needs: [deb11_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/debian-11:pkgbuild
script:
- bash debian/install_required_deps_debian.sh package_debian_11 pkg_min
- cd build
- export gnsstk=/usr/local
- cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../
- make install -j 4
dependencies:
- deb11_build
ubu20_system_install:
stage: install
needs: [ubu20_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/ubuntu-20.04:pkgbuild
script:
- bash debian/install_required_deps_debian.sh package_ubuntu_20.04 pkg_min
- cd build
- export gnsstk=/usr/local
- cmake -DCMAKE_INSTALL_PREFIX=$gnsstk ../
- make install -j 4
dependencies:
- ubu20_build
rhel8_system_install:
stage: install
needs: [rhel8_build]
extends: .normal_job
tags:
- docker-executor
image: $DOCKER_REGISTRY/sgl/centos-8:pkgbuild
script:
- bash rpm_files/install_required_deps_rpm.sh package_redhat_8 pkg_min