-
Notifications
You must be signed in to change notification settings - Fork 49
/
config.yml
executable file
·957 lines (837 loc) · 31 KB
/
config.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
anchors:
- ¤t3rdParty "2023-Jun"
- &srcLibID "1iWJtXpRY6kDAq3TyBWXtBIuWTB8oFR6a"
- &ubuntu20LibID "12z0l6Nl2OzJZArrXHOc2Zb4Vj3e0v7V5"
- &macOSx86LibID "17w6wUS5NIqUz8_s9zV98jeAjM-muWSfn"
- &macOSM1LibID "14610-_oYbF_qbiO3WoOu0FQhNNvzX6p7"
- &suseLibID "1pvdYktXqFM5_8kNd8lG1TT5-rI8Mspyf"
- &u20libAWS "2019-Aug-Win64.zip"
- &macx86libAWS "2023-Jun-macOSx86.tar.xz"
- &macArm64libAWS "2023-Sept-M1.tar.xz"
- &u20libAWS "2023-Sept-Ubuntu20.tar.xz"
version: 2.1
orbs:
win: circleci/windows@2.2.0
references:
workspace_root: &workspace_root
/tmp/workspace
attach_workspace: &attach_workspace
attach_workspace:
at: *workspace_root
commands:
get_libraries:
parameters:
useAWS:
type: boolean
default: true
fileName:
type: string
driveID:
type: string
sudo:
type: string
default: ""
steps:
- run:
name: get third party libraries
command: |
# if /usr/local/VAPOR-Deps is empty, acquire libraries
if [ ! -d /usr/local/VAPOR-Deps ]; then
<<parameters.sudo>> mkdir -p /usr/local/VAPOR-Deps
<<parameters.sudo>> chmod -R 777 /usr/local/VAPOR-Deps
<<parameters.sudo>> chown -R `whoami` /usr/local/VAPOR-Deps
if <<parameters.useAWS>> ; then
wget https://vaporawsbucket.s3.us-west-2.amazonaws.com/<<parameters.fileName>>
else
id=<<parameters.driveID>>
gdown https://drive.google.com/uc?id=${id}
fi
tar -xf <<parameters.fileName>> -C /usr/local/VAPOR-Deps
fi
build_vapor:
parameters:
branch:
type: string
default: $CIRCLE_BRANCH
beforeCompile:
type: string
default: ""
compileArgs:
type: string
default: ""
moveToCommand:
type: string
steps:
- run:
name: build vapor
command: |
libraryDir=`ls /usr/local/VAPOR-Deps`
ln -s $libraryDir /usr/local/VAPOR-Deps/current
cp site_files/site.NCAR site.local
mkdir -p build
cd build
git checkout <<parameters.branch>>
<<parameters.beforeCompile>>
cmake \
-DCMAKE_BUILD_TYPE:String=Release \
-DDIST_INSTALLER:string=ON \
-DUSE_OMP=ON \
<<parameters.compileArgs>> ..
make -j4
make installer
for f in VAPOR3-* ; do mv "$f" "<<parameters.moveToCommand>>" ; done
mkdir -p /tmp/workspace/installers
find VAPOR* -maxdepth 1 -type f -exec mv {} /tmp/workspace/installers \;
ls /tmp/workspace/installers
no_output_timeout: 30m
- store_artifacts:
path: /tmp/workspace/installers
- persist_to_workspace:
root: *workspace_root
paths:
- installers
smoke_tests:
steps:
- restore_cache:
name: restore smoke test data
keys:
- smoke-test-data
- run:
name: Acquire smoke test data
command: |
if [ -z "$(ls -A /smokeTestData)" ]; then
mkdir -p /smokeTestData
wget https://vaporawsbucket.s3.us-west-2.amazonaws.com/smokeTestData.tar.gz
tar --no-same-owner -xf /root/project/smokeTestData.tar.gz -C /smokeTestData
chown -R root:root /smokeTestData
chmod -R 777 /smokeTestData
else
echo "Data already acquired"
fi
- save_cache:
key: smoke-test-data
paths:
- /smokeTestData
- run:
name: Smoke tests
command: |
python3 ~/project/test_apps/smokeTests/smokeTests.py \
-testDataRoot=/smokeTestData/smokeTestData \
-binaryRoot=~/project/build/test_binaries \
-resultsDir=~/project/test_apps/smokeTests/testResults
- store_artifacts:
path: ~/project/test_apps/smokeTests/testResults
suse_prerequisites:
steps:
- run:
name: Acquire suse prerequisites
command: |
zypper install -y -t pattern devel_C_C++
zypper install -y \
gzip \
xz \
git \
gcc7-fortran \
cmake \
curl \
libomp-devel \
libicu-devel \
freeglut-devel \
python3-pip
pip install gdown
jobs:
build_win10_installer:
executor: win/default
steps:
- checkout
- run:
name: Install dependencies
command: |
choco install visualstudio2019-workload-vctools -y
choco install python -y
choco install git -y
choco install cmake -y
choco install nsis -y
python -m pip install gdown
setx /M PATH "%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
msbuild -version
pwd
ls
python .circleci/downloadWin3rdParty.py
no_output_timeout: 20m
- run:
name: dos2unix
command: |
dos2unix /c/Users/circleci/project/share/shaders/*
dos2unix /c/Users/circleci/project/share/shaders/main
dos2unix /c/Users/circleci/project/share/shaders/includes
shell: bash.exe
- run:
name: Build Vapor
command: |
Copy-Item site_files\* -Destination .
mkdir build
cd build
git checkout $CIRCLE_BRANCH
& 'C:\\Program Files\\CMake\\bin\\cmake.exe' -S C:\Users\circleci\project -B C:\Users\circleci\project\build -DDIST_INSTALLER:string=ON -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_OSP=OFF -G 'Visual Studio 16 2019' -A x64
msbuild C:\Users\circleci\project\build\PACKAGE.vcxproj /p:Configuration=Release /p:Platform=x64
mkdir -p C:\Users\circleci\project\tmp\workspace\installers
Copy-Item C:\Users\circleci\project\build\*.exe -Destination C:\Users\circleci\project\tmp\workspace\installers
no_output_timeout: 45m
- store_artifacts:
path: C:\Users\circleci\project\tmp\workspace\installers
- persist_to_workspace:
root: C:\Users\circleci\project\tmp\workspace
paths:
- installers
build_macOS_installers:
macos:
xcode: "14.3.1"
resource_class: macos.m1.large.gen1
steps:
- checkout
- run:
name: permit cache restore
command: sudo chmod -R 777 /opt
- restore_cache:
name: restore dependencies
keys:
- macos-deps2
- run:
name: Get dependencies
command: |
pip install gdown
# MacPorts
curl -k -O https://distfiles.macports.org/MacPorts/MacPorts-2.8.1.tar.bz2
tar xf MacPorts-2.8.1.tar.bz2
cd MacPorts-2.8.1/
./configure
make -j6
sudo make install
sudo /opt/local/bin/port -v selfupdate
# CMake
(sudo yes || true) | sudo /opt/local/bin/port install cmake
# clang
# If we run selfupdate on every run, we will update clang on minor revisions, taking 1+ hours to build
# Therefore, skip selfupdate until we know we want a newer version of clang
#(sudo yes || true) | sudo /opt/local/bin/port install clang-17 +universal
#sudo /opt/local/bin/port select --set clang mp-clang-17
#/opt/local/bin/clang++ -v > clangVersion.txt
no_output_timeout: 45m
- save_cache:
key: macos-deps2
paths:
- /opt/local
#- get_libraries:
# fileName: 2023-Sept-M1.tar.xz
# driveID: *macOSM1LibID
# sudo: sudo
- get_libraries:
fileName: 2023-Jun-macOSx86.tar.xz
driveID: *macOSx86LibID
sudo: sudo
- build_vapor:
#beforeCompile: export PATH=/opt/local/bin:$PATH; sudo port select --set clang mp-clang-17
beforeCompile: export PATH=/opt/local/bin:$PATH; softwareupdate --install-rosetta --agree-to-license; sudo port select --set clang mp-clang-17
compileArgs: |
-DCPACK_BINARY_DRAGNDROP=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DBUILD_OSP=OFF \
moveToCommand: ${f/Darwin/DarwinM1}
#- run:
# name: remove old libraries
# command: sudo rm -rf /usr/local/VAPOR-Deps
#- get_libraries:
# fileName: 2023-Jun-macOSx86.tar.xz
# driveID: *macOSx86LibID
# sudo: sudo
- build_vapor:
beforeCompile: export PATH=/opt/local/bin:$PATH; softwareupdate --install-rosetta --agree-to-license; sudo port select --set clang mp-clang-17
compileArgs: |
-DCPACK_BINARY_DRAGNDROP=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
moveToCommand: ${f/Darwin/Darwinx86}
clang-tidy:
docker:
- image: ubuntu:latest
steps:
- run:
name: Install dependencies
command: |
apt-get update
apt upgrade -y
apt install -y aptitude
aptitude install -y xz-utils pip git curl jq cmake cmake-curses-gui freeglut3-dev libexpat1-dev libglib2.0-0 libdbus-1-3 lsb-release wget software-properties-common clang-tidy
pip install gdown
- run:
name: Install llvm
command: |
add-apt-repository -y universe
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
yes '' | ./llvm.sh 14 || if [[ $? -eq 141 ]]; then true; else exit $?; fi # Feed "yes" to all of the script's questions and igore error 141
- run:
name: Get third party libraries
command: |
mkdir -p /usr/local/VAPOR-Deps
cd /usr/local/VAPOR-Deps
gdown https://drive.google.com/uc?id=1elB8v-UNMzkNmnsJPtxk3cI1zBelJ3Hd
tar xf 2019-Aug-Ubuntu.tar.xz
- run:
name: Run clang-tidy
command: |
git clone https://github.com/NCAR/VAPOR.git /root/VAPOR
cd /root/VAPOR
git checkout $CIRCLE_BRANCH
apt install -y libomp-dev
cmake . \
-DCMAKE_BUILD_TYPE:String=Release \
-DCMAKE_CXX_COMPILER=clang++-14 \
-DCMAKE_C_COMPILER=clang-14 \
-DBUILD_TEST_APPS=ON \
-DUSE_OMP=ON
make -j4
git diff $(git merge-base --fork-point origin/main HEAD) HEAD | \
/usr/bin/clang-tidy-diff-14.py -path /root/VAPOR -p1 -checks=cppcoreguidelines* 2>&1 | \
tee /tmp/clangTidyOutput.txt
- store_artifacts:
path: /tmp/clangTidyOutput.txt
- run:
name: Copy artifact link to PR
command: |
# acquire clang-tidy report artifact
artifacts=$(curl \
-X GET "https://circleci.com/api/v2/project/github/NCAR/VAPOR/$CIRCLE_BUILD_NUM/artifacts" \
-H "Accept: application/vnd.github.v3+json" \
-u "$GITHUB_TOKEN:" | jq '.items[0].url')
artifacts="${artifacts//\"}" # remove quotes from string
artifacts=" [clangTidyOutput.txt]($artifacts)" # make hyperlink
# Temporarily remove windows carraige return \r
originalBody=$(curl https://api.github.com/repos/NCAR/VAPOR/pulls/${CIRCLE_PULL_REQUEST##*/} | jq '.body')
lineArray=(${originalBody//\\r\\n/\\n})
# Remove leading " at the start of the first element
firstElement=${lineArray[0]}
if [[ ${firstElement::1} == "\"" ]]
then
lineArray[0]="${firstElement:1}"
fi
# Remove trailing " at the end of the last element
lastElement=${lineArray[-1]}
if [[ ${lastElement: -1} == "\"" ]]
then
lineArray[-1]=${lastElement::-1}
fi
# If clang-tidy has already been reported in this PR, remove that report
if [[ "${lineArray[-1]}" == *"clangTidyOutput.txt"* ]]; then
echo " *** Previous clangTidyOutput.txt report found. Replacing with new version. ***"
unset lineArray[-1] # delete line with commit hash
unset lineArray[-1] # delete line with clangTidyOutput.txt
else
lineArray+=("\\n\\n")
fi
newBody=""
newBody=${lineArray[@]//\\n/\\r\\n} # Add windows carraige return \r on line endings
newBody="${newBody}\r\n\r\n${CIRCLE_SHA1}:${artifacts}"
json="{\"body\":\"$newBody\"}" # Apply our re-written PR body in json format
# Add linke to PR
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $CIRCLE_CLANG_TIDY_TOKEN" \
https://api.github.com/repos/NCAR/VAPOR/issues/${CIRCLE_PULL_REQUEST##*/} \
-d "$json"
build_python_api_ubuntuDebug:
docker:
- image: conda/miniconda3 # Debian based docker image
resource_class: xlarge
steps:
- checkout
- run:
name: conda build .
command: |
cd /root/project/conda
conda update -y -n base -c defaults conda
conda install -y conda-build
conda config --add channels conda-forge
conda config --add channels ncar-vapor
conda build .
mkdir /usr/local/conda-bld/linux-64/tarBallDir
mv /usr/local/conda-bld/linux-64/*.tar.bz2 /usr/local/conda-bld/linux-64/tarBallDir
no_output_timeout: 180m
- store_artifacts:
path: /usr/local/conda-bld/linux-64/tarBallDir
build_python_api_ubuntu:
docker:
- image: conda/miniconda3 # Debian based docker image
resource_class: large
steps:
- checkout
- run:
name: acquire map image archive
command: |
cd /root
# The following resolves the error "E: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file."
echo "deb http://archive.debian.org/debian stretch main contrib non-free" > /etc/apt/sources.list
apt update
apt install -y git
git clone https://github.com/NCAR/VAPOR-Data.git
- run:
name: build conda installer
command: |
conda update -y -n base -c defaults conda
conda config --add channels ncar-vapor
conda config --add channels conda-forge
conda install -y conda-build
cd /root/project/conda
#conda build .
DEBUG_BUILD=false MAP_IMAGES_PATH="/root/VAPOR-Data/images" conda build .
mkdir /usr/local/conda-bld/linux-64/tarBallDir
mv /usr/local/conda-bld/linux-64/*.tar.bz2 /usr/local/conda-bld/linux-64/tarBallDir
no_output_timeout: 180m
- store_artifacts:
path: /usr/local/conda-bld/linux-64/tarBallDir
build_python_api_osx:
macos:
xcode: "13.4.1"
steps:
- checkout
- run:
name: install miniconda
command: |
brew install wget
wget https://repo.continuum.io/miniconda/Miniconda3-py39_4.9.2-MacOSX-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p ~/miniconda
- run:
name: acquire map image archive
command: |
cd /Users/distiller
git clone https://github.com/NCAR/VAPOR-Data.git
- run:
name: conda build .
command: |
cd /Users/distiller/project/conda
/Users/distiller/miniconda/bin/conda install -y conda-build anaconda conda-verify
/Users/distiller/miniconda/bin/conda config --add channels conda-forge
DEBUG_BUILD=false MAP_IMAGES_PATH="/Users/distiller/VAPOR-Data/images" /Users/distiller/miniconda/bin/conda build .
mkdir -p /tmp/workspace/installers
mv /Users/distiller/miniconda/conda-bld/osx-64/*.tar.bz2 /tmp/workspace/installers
cd /tmp/workspace/installers
fileName=${ls}
newFileName=${fileName//vapor/vaporUbuntu}
no_output_timeout: 30m
- store_artifacts:
path: /tmp/workspace/installers
build_suse_installer:
docker:
- image: opensuse/leap
resource_class: large
steps:
- suse_prerequisites
- checkout
- get_libraries:
fileName: 2023-Sept-SUSE.tar.xz
driveID: *suseLibID
- build_vapor:
moveToCommand: ${f/Linux/SUSE}
compileArgs: -DBUILD_TEST_APPS=ON
- persist_to_workspace:
root: *workspace_root
paths:
- installers
suse_smoke_tests:
docker:
- image: opensuse/leap
resource_class: medium
steps:
- suse_prerequisites
- attach_workspace:
at: /
- smoke_tests
build_linux_installer:
docker:
- image: ubuntu:20.04
resource_class: xlarge
steps:
- checkout
- run:
name: acquire prerequisites
command: |
export DEBIAN_FRONTEND=noninteractive
apt update
apt install -y curl
apt install -y xz-utils
apt install -y git
apt install -y g++
apt install -y libomp-dev
apt install -y freeglut3-dev
apt install -y libexpat1-dev
apt install -y libglib2.0-0
apt install -y libdbus-1-3
apt install -y valgrind
apt install -y clang-tidy
apt install -y lsb-release
apt install -y python3-pip
pip3 install gdown
git config --global --add safe.directory /tmp/_circleci_local_build_repo
# all for cmake
apt-get update
apt-get install -y gpg wget
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb
dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null
DEBIAN_FRONTEND=noninteractive apt install -y software-properties-common
apt-add-repository -y 'deb https://apt.kitware.com/ubuntu/ focal main'
apt install -y cmake --allow-unauthenticated
# for AppImage
apt install -y \
libxcb-icccm4-dev \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-render-util0 \
libxkbcommon-x11-0 \
desktop-file-utils
- restore_cache:
name: restore intel's oneapi
keys:
- intelOneapi
- run:
name: acquire intel hpckit for bundling ospray
command: |
# if not restored from cache, acquire oneapi
if [ ! -d /opt/intel/oneapi ]; then
# For bundling Ospray, which wants Intel's MPI implementation to be bundled
apt install -y linux-headers-5.15.0-1053-aws
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list
apt update
apt install -y intel-hpckit
fi
- save_cache:
key: intelOneapi
paths:
- /opt/intel/oneapi
- restore_cache:
name: restore third party libraries
keys:
- ubuntu-libs-mar2023
- get_libraries:
fileName: 2023-Sept-Ubuntu20.tar.xz
driveID: *u20libAWS
- save_cache:
key: ubuntu-libs-mar2023
paths:
- /usr/local
- build_vapor:
moveToCommand: ${f/Linux/Ubuntu20}
compileArgs: |
-DDIST_APPIMAGE=ON \
-DBUILD_TEST_APPS=ON \
- smoke_tests
test_clang_format:
docker:
- image: ubuntu:20.04
steps:
- run:
name: install deps
command: |
apt-get update
apt-get install -y clang-format-11
apt-get install -y git
- checkout
- run:
name: run clang-format
command: |
for COMMIT in $(git log --pretty=format:%h main...$BRANCH); do
for FILE in $(git diff --name-only origin/main |grep -E "\.h|\.cpp"); do
NUMBERS=""
for NUMBER in $(git blame --line-porcelain "$FILE" | egrep ^$COMMIT | cut -d' ' -f3); do
NUMBERS="$NUMBERS --lines $NUMBER:$NUMBER "
done
if [ "$NUMBERS" != "" ]; then
echo " Running clang-format on $FILE"
clang-format-11 --dry-run $FILE $NUMBERS >> /tmp/clang-format.txt 2>&1
fi
done
done
- store_artifacts:
path: /tmp/clang-format.txt
- run:
name: check formatting
command: |
if grep -q warning /tmp/clang-format.txt; then
cat /tmp/clang-format.txt
exit -1
else
exit 0
fi
check_leaks:
docker:
- image: sgpearse/vapor3-ubuntu18:latest
steps:
- checkout
- run:
name: cmake and make
command: |
cd /VAPOR
git pull
cd build
cmake -DCMAKE_BUILD_TYPE:String=Release ..
make -j2
#valgrind --leak-check=yes bin/vapor > /tmp/output.txt
valgrind --leak-check=yes bin/vaporpychecker &> /tmp/vaporpychecker.txt
#valgrind --leak-check=yes bin/vapor &> /tmp/vapor.txt
#bin/vapor &> /tmp/vapor.txt
- store_artifacts:
path: /tmp/*.txt
release_weekly_installers:
macos:
xcode: "13.4.1"
steps:
- checkout
#- run:
# name: get main
# command: |
# git checkout main
# git pull --no-commit && git commit --allow-empty -m "Merge"
# git reset --hard origin/main
- *attach_workspace
- run:
name: publish release
command: |
cd /Users/distiller/project
hash=`git rev-parse HEAD`
tag="Weekly"
cd /tmp/workspace/installers
brew install ghr
endl=$'\n'
title="sha 256"$endl
a="Ubuntu18: "
sha=`shasum -a 256 VAPOR3*Ubuntu*`
ubuntuSha=$a$sha$endl
#os="OSX: "
#sha=`shasum -a 256 VAPOR3*Darwin*`
#osxSha=$os$sha$endl
#os="M1: "
#sha=`shasum -a 256 VAPOR3*M1*`
#osxSha=$os$sha$endl
#os="Windows: "
#sha=`shasum -a 256 VAPOR3*win64*`
#winSha=$os$sha$endl
shaMessage="$title$ubuntuSha$osxSha$m1Sha$winSha"
date=`date +"%d_%m_%y"`
echo $shaMessage > "/tmp/workspace/installers/sha256.txt"
echo ghr -b "Weekly installers are untested an may not be stable. Built with commit ${hash} on ${date} \(DD-MM-YY\)" -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -prerelease -c ${CIRCLE_SHA1} -recreate -c ${hash} -n ${tag} ${tag} /tmp/workspace/installers
ghr -b "Weekly installers are untested an may not be stable. Built with commit ${hash} on ${date} \(DD-MM-YY\)" -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -prerelease -c ${CIRCLE_SHA1} -recreate -c ${hash} -n ${tag} ${tag} /tmp/workspace/installers
build_suse_libs:
docker:
- image: opensuse/leap:latest
resource_class: xlarge
steps:
- checkout
- run:
name: acquire prerequisites
command: |
zypper install -y \
curl \
tar \
gzip \
xz \
zlib-devel \
bzip2 \
make \
which \
git
- get_libraries:
fileName: 2023-Sept-src.tar.xz
driveID: *srcLibID
- run:
name: build libraries
command: |
chmod 777 /root/project/scripts/build3rdParty.sh
/root/project/scripts/build3rdParty.sh -o suse
- build_vapor:
moveToCommand: ${f/Linux/Ubuntu20}
- store_artifacts:
path: |
/tmp/workspace/installers
- store_artifacts:
path: /usr/local/VAPOR-Deps/2023-Sept-SUSE.tar.xz
build_ubuntu20_libs:
docker:
- image: ubuntu:20.04
resource_class: xlarge
steps:
- run:
name: acquire prerequisites
command: |
DEBIAN_FRONTEND=noninteractive
apt update
apt install -y xz-utils git curl libomp-dev
git config --global --add safe.directory /tmp/_circleci_local_build_repo
- checkout
- get_libraries:
fileName: 2023-Sept-src.tar.xz
driveID: *srcLibID
- run:
name: build libraries
command: |
chmod 777 /root/project/scripts/build3rdParty.sh
/root/project/scripts/build3rdParty.sh -o Ubuntu
no_output_timeout: 60m
- build_vapor:
moveToCommand: ${f/Linux/Ubuntu20}
- store_artifacts:
path: /tmp/workspace/installers
- store_artifacts:
path: /usr/local/VAPOR-Deps/2023-Sept-Ubuntu.tar.xz
build_macOSx86_libs:
macos:
xcode: "13.4.1"
resource_class: macos.x86.medium.gen2
steps:
- checkout
- run:
name: Get MacPorts
command: |
curl -k -O https://distfiles.macports.org/MacPorts/MacPorts-2.7.1.tar.bz2
tar xf MacPorts-2.7.1.tar.bz2
cd MacPorts-2.7.1/
./configure
make -j6
sudo make install
- run:
name: Get clang13
command: |
sudo /opt/local/bin/port selfupdate
(sudo yes || true) | sudo /opt/local/bin/port install clang-13
sudo /opt/local/bin/port select --set clang mp-clang-13
/opt/local/bin/clang++ -v > clangVersion.txt
no_output_timeout: 30m
- get_libraries:
fileName: 2023-Sept-src.tar.xz
driveID: *srcLibID
sudo: sudo
- run:
name: build libraries
command: |
chmod 777 /Users/distiller/project/scripts/build3rdParty.sh
/Users/distiller/project/scripts/build3rdParty.sh -o macOSx86
- build_vapor:
beforeCompile: export PATH=/opt/local/bin:$PATH; softwareupdate --install-rosetta --agree-to-license; sudo port select --set clang mp-clang-13
compileArgs: |
-DCPACK_BINARY_DRAGNDROP=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
-DMACOS_BUILD_ARM64=OFF \
moveToCommand: ${f/Darwin/DarwinM1}
- store_artifacts:
path: /tmp/workspace/installers
- store_artifacts:
path: /usr/local/VAPOR-Deps/2023-Sept-macOSx86.tar.xz
build_M1_libs:
macos:
#xcode: "14.2.0"
xcode: "13.4.1"
resource_class: macos.m1.large.gen1
steps:
- checkout
- get_libraries:
fileName: 2023-Sept-src.tar.xz
driveID: *srcLibID
sudo: sudo
- run:
name: Get MacPorts
command: |
curl -k -O https://distfiles.macports.org/MacPorts/MacPorts-2.7.1.tar.bz2
tar xf MacPorts-2.7.1.tar.bz2
cd MacPorts-2.7.1/
./configure
make -j8
sudo make install
- run:
name: Get clang13
command: |
sudo /opt/local/bin/port selfupdate
(sudo yes || true) | sudo /opt/local/bin/port install clang-13
sudo /opt/local/bin/port select --set clang mp-clang-13
/opt/local/bin/clang++ -v > clangVersion.txt
no_output_timeout: 30m
- run:
name: build libraries
command: |
chmod 777 /Users/distiller/project/scripts/build3rdParty.sh
/Users/distiller/project/scripts/build3rdParty.sh -o M1
- build_vapor:
beforeCompile: export PATH=/opt/local/bin:$PATH
compileArgs: |
-DCPACK_BINARY_DRAGNDROP=ON \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER=clang \
moveToCommand: ${f/Darwin/DarwinM1}
- store_artifacts:
path: /tmp/workspace/installers
- store_artifacts:
path: /usr/local/VAPOR-Deps/2023-Sept-M1.tar.xz
build_win10_libs:
executor: win/default
steps:
- checkout
- run:
name: get source files
command: |
gdown https://drive.google.com/uc?id=1FG8ngmz9Tk3HKZgGejqwtbkBAVonm91z
tar xvf ${filename} -C /usr/local/VAPOR-Deps
msbuild -version
- run:
name: build libraries
command: |
chmod 777 /root/project/scripts/build3rdParty.sh
/root/project/scripts/build3rdParty.sh -o Windows
- store_artifacts:
path: C:\Users\circleci\project\tmp\workspace\installers
workflows:
version: 2
build:
jobs:
#- build_python_api_ubuntuDebug
#- build_python_api_ubuntu
#- build_python_api_osx
- build_win10_installer
- build_macOS_installers
- build_linux_installer
#- build_suse_installer
#- build_ubuntu20_libs
#- build_macOSx86_libs
#- build_M1_libs
#- build_suse_libs
#- build_windows_libs
- release_weekly_installers:
requires:
- build_win10_installer
- build_macOS_installers
- build_linux_installer
weekly:
triggers:
- schedule:
cron: "30 5 * * 4" #Time is GMT
filters:
branches:
only: main
jobs:
- build_linux_installer
- build_macOS_installers
- build_win10_installer
#- build_python_api_ubuntu
#- build_python_api_osx
- release_weekly_installers:
requires:
- build_linux_installer
- build_macOS_installers
- build_win10_installer
#- build_python_api_ubuntu
#- build_python_api_osx