forked from MiniZinc/libminizinc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
138 lines (126 loc) · 4.16 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
stages:
- build
- trigger
.download_script: &download_script
- curl --location --header "PRIVATE-TOKEN:$ACCESS_TOKEN" --silent https://gitlab.com/api/v4/snippets/1796163/raw | tr -d '\r' > download.sh
variables:
# Vendor solver locations
GECODE_ROOT: "$CI_PROJECT_DIR/vendor/gecode"
GUROBI_ROOT: "$CI_PROJECT_DIR/vendor/gurobi"
CPLEX_ROOT: "$CI_PROJECT_DIR/vendor/CPLEX_Studio/cplex"
OSICBC_ROOT: "$CI_PROJECT_DIR/vendor/cbc"
# CCache settings
CCACHE_DIR: "$CI_PROJECT_DIR/.ccache"
CCACHE_MAXSIZE: "100M"
.build_template: &build_definition
stage: build
before_script: *download_script
script:
- sh download.sh vendor master vendor:${MZNARCH} vendor.zip
- unzip -q vendor.zip
- mkdir -p build
- cd build
- cmake -G"$CMAKE_ARCH" -DCMAKE_BUILD_TYPE=Release -v .. -DBUILD_REF=$CI_PIPELINE_ID -DUSE_PROPRIETARY=OFF -DCMAKE_INSTALL_PREFIX="$CI_PROJECT_DIR/minizinc"
- cmake --build . --config Release
- cmake --build . --config Release --target install
artifacts:
paths: [minizinc/]
cache:
key: "$CI_JOB_NAME"
paths: [.ccache, vendor.zip*]
build:linux:
<<: *build_definition
image: dekker1/minibuild:cpp
variables:
MZNARCH: "linux"
CMAKE_ARCH: "Ninja"
tags: [linux, docker]
build:musl:
<<: *build_definition
image: dekker1/minibuild:alpine
variables:
MZNARCH: "musl"
CMAKE_ARCH: "Ninja"
tags: [linux, docker]
build:osx:
<<: *build_definition
stage: build
variables:
MZNARCH: "osx"
CMAKE_ARCH: "Ninja"
tags: [osx, cmake, cpp]
build:win64:
stage: build
variables:
MZNARCH: "win64"
CMAKE_ARCH: "Visual Studio 15 2017 Win64"
before_script:
- curl -o download.sh --location --header "PRIVATE-TOKEN:%ACCESS_TOKEN%" --silent https://gitlab.com/api/v4/snippets/1796163/raw
- dos2unix download.sh
script:
- sh download.sh vendor master vendor:%MZNARCH% vendor.zip
- unzip -q vendor.zip
- if not exist "build" mkdir build
- cd build
- cmake -G"%CMAKE_ARCH%" .. -DBUILD_REF=%CI_PIPELINE_ID% -DUSE_PROPRIETARY=OFF -DCMAKE_INSTALL_PREFIX="%CI_PROJECT_DIR%/minizinc"
- cmake --build . --config Release
- cmake --build . --config Release --target install
artifacts:
paths: [minizinc/]
cache:
key: "win64"
paths: [vendor.zip*]
tags: [win64, cmake, cpp]
build:wasm_complete:
image: trzeci/emscripten
stage: build
variables:
MZNARCH: "wasm"
CMAKE_ARCH: "Unix Makefiles"
tags: [docker]
before_script: *download_script
script:
- sh download.sh vendor master vendor:wasm vendor.zip
- unzip -q vendor.zip
- mkdir -p build
- cd build
- emconfigure cmake -G"$CMAKE_ARCH" -DCMAKE_FIND_ROOT_PATH="/" -DGECODE_ROOT="$GECODE_ROOT" -DOSICBC_ROOT="$OSICBC_ROOT" -DCMAKE_BUILD_TYPE=MinSizeRel -DEMSCRIPTEN_GENERATE_BITCODE_STATIC_LIBRARIES=1 -v .. -DBUILD_REF=$CI_PIPELINE_ID -DUSE_PROPRIETARY=OFF -DCMAKE_INSTALL_PREFIX="$CI_PROJECT_DIR/minizinc"
- cmake --build . --config MinSizeRel
- cmake --build . --config MinSizeRel --target install
artifacts:
paths: [minizinc/]
cache:
key: "$CI_JOB_NAME"
paths: [.ccache, vendor.zip*]
when: manual
build:wasm_minimal:
image: trzeci/emscripten
stage: build
variables:
MZNARCH: "wasm"
CMAKE_ARCH: "Unix Makefiles"
tags: [docker]
before_script: *download_script
script:
- sh download.sh vendor master vendor:wasm vendor.zip
- unzip -q vendor.zip
- mkdir -p build
- cd build
- emconfigure cmake -G"$CMAKE_ARCH" -DCMAKE_BUILD_TYPE=MinSizeRel -DEMSCRIPTEN_GENERATE_BITCODE_STATIC_LIBRARIES=1 -v .. -DBUILD_REF=$CI_PIPELINE_ID -DUSE_PROPRIETARY=OFF -DCMAKE_INSTALL_PREFIX="$CI_PROJECT_DIR/minizinc"
- cmake --build . --config MinSizeRel
- cmake --build . --config MinSizeRel --target install
artifacts:
paths: [minizinc/]
cache:
key: "$CI_JOB_NAME"
paths: [.ccache, vendor.zip*]
when: manual
# ----------- Trigger FindMUS pipeline -----------
trigger:findmus:
stage: trigger
image: dekker1/minibuild:package
script:
- "curl --request POST --form token=$TRIGGER --form ref=master https://gitlab.com/api/v4/projects/minizinc%2FFindMUS/trigger/pipeline"
dependencies: []
tags: [linux, docker]
only: [develop]