-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
115 lines (108 loc) · 3.02 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
image: base/devel
stages:
- sync
- build
- test
# Templates with reasonable defaults for builds and tests
.variables_template: &default_variables
C_COMPILER: gcc
CXX_COMPILER: g++
BUILD_TYPE: Debug
BUILD_REFERENCE: "ON"
BUILD_CPU: "SOFF"
BUILD_GPU: "OFF"
EXTRA_CMAKE_FLAGS: ""
EXTRA_PACKAGES: ""
.before_script_template: &default_before_script
- pacman-db-upgrade
- pacman --noconfirm -Syu cmake git python ${EXTRA_PACKAGES}
.build_template: &default_build
stage: build
variables: *default_variables
before_script: *default_before_script
script:
- mkdir -p ${CI_JOB_NAME} && cd ${CI_JOB_NAME}
- cmake ${CI_PROJECT_DIR}
-DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${CXX_COMPILER}
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DBUILD_SHARED_LIBS=ON
${EXTRA_CMAKE_FLAGS} -DDEVEL_TOOLS=OFF
-DBUILD_REFERENCE=${BUILD_REFERENCE} -DBUILD_CPU=${BUILD_CPU}
-DBUILD_GPU=${BUILD_GPU} -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON
- make -j$(grep "core id" /proc/cpuinfo | sort -u | wc -l)
artifacts:
paths:
- build/
.test_template: &default_test
stage: test
before_script: *default_before_script
script:
- cd ${CI_JOB_NAME/test/build}
- make test
sync:
stage: sync
variables:
GIT_STRATEGY: none
PRIVATE_REPO: [email protected]:ginkgo-bot/test.git
PUBLIC_REPO: [email protected]:ginkgo-bot/test.git
before_script:
- pacman-db-upgrade
- pacman --noconfirm -Syu openssh git
- eval $(ssh-agent -s)
- echo "${BOT_KEY}" | tr -d '\r' | ssh-add - >/dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- ssh-keyscan -t rsa gitlab.com github.com >>~/.ssh/known_hosts
- git config --global user.name "${BOT_USER}"
- git config --global user.emal "${BOT_EMAIL}"
script:
- git clone ${PRIVATE_REPO} -b ${CI_COMMIT_REF_NAME} repo_sync
- cd repo_sync
- git pull --ff-only ${PUBLIC_REPO} ${CI_COMMIT_REF_NAME}
- git push ${PRIVATE_REPO} ${CI_COMMIT_REF_NAME}
- git push ${PUBLIC_REPO} ${CI_COMMIT_REF_NAME}
only:
- master
- develop
# Build jobs
# build/gcc/reference/debug:
# <<: *default_build
#
# build/clang/reference/debug:
# <<: *default_build
# variables:
# <<: *default_variables
# C_COMPILER: clang
# CXX_COMPILER: clang++
# EXTRA_PACKAGES: clang
#
# build/gcc/all/debug:
# <<: *default_build
# variables:
# <<: *default_variables
# EXTRA_PACKAGES: cuda
# BUILD_CPU: "ON"
# BUILD_GPU: "ON"
# EXTRA_CMAKE_FLAGS: &cuda_flags
# -DCMAKE_CUDA_COMPILER=/opt/cuda/bin/nvcc -DCUDA_ARCH_OPTION=60
#
# build/clang/all/debug:
# <<: *default_build
# variables:
# <<: *default_variables
# EXTRA_PACKAGES: clang cuda
# C_COMPILER: clang
# CXX_COMPILER: clang++
# BUILD_CPU: "ON"
# BUILD_GPU: "ON"
# EXTRA_CMAKE_FLAGS: *cuda_flags
#
# # Test jobs
# test/gcc/reference/debug:
# <<: *default_test
# dependencies:
# - build/gcc/reference/debug
#
# test/clang/reference/debug:
# <<: *default_test
# dependencies:
# - build/clang/reference/debug