forked from tamasmeszaros/libnest2d
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
91 lines (86 loc) · 3.24 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
# use the official gcc image, based on debian
# can use verions as well, like gcc:5.2
# see https://hub.docker.com/_/gcc/
# image: meszarosq/phoenix:latest
stages:
- build
- test
build-clang:
image: registry.gitlab.com/meszaros.q/libnest2d/ubuntu-clang
stage: build
tags:
- linux
- clang
# instead of calling g++ directly you can also use some build toolkit like make
# install the necessary build tools when needed
# before_script:
# - apt update && apt -y install cmake ninja-build git clang-7 # libpolyclipping-dev libnlopt-cxx-dev libboost-dev
script:
- mkdir -p build-clang
- cd build-clang
- cmake .. -GNinja -DCMAKE_CXX_COMPILER=clang++-7 -DCMAKE_C_COMPILER=clang-7 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./dist -DLIBNEST2D_BUILD_UNITTESTS=ON -DRP_ENABLE_DOWNLOADING=ON -DLIBNEST2D_HEADER_ONLY=OFF -DLIBNEST2D_THREADING=tbb
- cmake --build . --target install
- cd ..
- mkdir -p build_example_dist && cd build_example_dist
- cmake ../examples -GNinja -DCMAKE_CXX_COMPILER=clang++-7 -DCMAKE_C_COMPILER=clang-7 -DCMAKE_PREFIX_PATH="../build-clang/dist;../build-clang/dependencies"
- cmake --build .
artifacts:
paths:
- build-clang/tests/tests_clipper_nlopt
# depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
# cache:
# key: "$CI_JOB_ID"
# paths:
# - "build-clang/dependencies/*"
build-gcc:
image: registry.gitlab.com/meszaros.q/libnest2d/ubuntu-gcc
stage: build
tags:
- linux
- gcc
# instead of calling g++ directly you can also use some build toolkit like make
# install the necessary build tools when needed
# before_script:
#- apt update && apt -y install cmake ninja-build git g++ # libpolyclipping-dev libnlopt-cxx-dev libboost-dev
script:
- mkdir -p build-gcc
- cd build-gcc
- cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./dist -DLIBNEST2D_BUILD_UNITTESTS=ON -DRP_ENABLE_DOWNLOADING=ON -DLIBNEST2D_HEADER_ONLY=OFF
- cmake --build . --target install
- cd ..
- mkdir -p build_example_dist && cd build_example_dist
- cmake ../examples -GNinja -DCMAKE_PREFIX_PATH="../build-gcc/dist;../build-gcc/dependencies"
- cmake --build .
artifacts:
paths:
- build-gcc/tests/tests_clipper_nlopt
# depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
# cache:
# key: "$CI_JOB_ID"
# paths:
# - "build-gcc/dependencies/*"
# run tests using the binary built before
test-clang:
image: registry.gitlab.com/meszaros.q/libnest2d/ubuntu-clang
stage: test
tags:
- linux
#before_script:
# - apt update && apt -y install libpolyclipping22 libnlopt-cxx0 libnlopt0
script:
- cd build-clang/tests && ./tests_clipper_nlopt -r "junit" --out report-clang.xml
artifacts:
reports:
junit: build-clang/tests/report-clang.xml
test-gcc:
image: registry.gitlab.com/meszaros.q/libnest2d/ubuntu-gcc
stage: test
tags:
- linux
#before_script:
# - apt update && apt -y install libpolyclipping22 libnlopt-cxx0 libnlopt0
script:
- cd build-gcc/tests && ./tests_clipper_nlopt -r "junit" --out report-gcc.xml
artifacts:
reports:
junit: build-gcc/tests/report-gcc.xml