-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.gitlab-ci.yml
169 lines (161 loc) · 4.68 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
build-emscripten:
stage: build
image: trzeci/emscripten
variables:
GIT_SUBMODULE_STRATEGY: normal
script:
- export CXX="emcc"
- cmake .
- make
- mkdir ci-build
- cp -r bin/* ci-build
artifacts:
paths:
- ci-build
build-clang:
stage: build
image: ubuntu:18.04
variables:
GIT_SUBMODULE_STRATEGY: normal
script:
- apt-get update
- apt-get -y --no-install-recommends install wget gnupg2 ca-certificates
- wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add -
- apt-get update
# apt-get -y --no-install-recommends install cmake
- apt-get -y --no-install-recommends install clang-8 lld-8 llvm make
- clang++-8 --version
- mkdir /opt/cmake
- pushd /opt/cmake
- wget https://github.com/Kitware/CMake/releases/download/v3.15.3/cmake-3.15.3-Linux-x86_64.tar.gz
- tar -xvzf cmake-3.15.3-Linux-x86_64.tar.gz
- popd
- ln -s /opt/cmake/cmake-3.15.3-Linux-x86_64/bin/cmake /usr/local/bin/cmake
- whereis clang-8
- export CC="clang-8"
- whereis clang++-8
- export CXX="clang++-8"
- cmake .
- make
- mkdir -p ci-build/test
- mv bin/test/tests ci-build/test/tests-clang
artifacts:
paths:
- ci-build
build-gcc:
stage: build
image: ubuntu:18.04
variables:
GIT_SUBMODULE_STRATEGY: normal
script:
- apt-get update
- apt-get -y --no-install-recommends install build-essential wget make ca-certificates
- gcc --version
- wget https://github.com/Kitware/CMake/releases/download/v3.15.3/cmake-3.15.3-Linux-x86_64.sh
- mkdir /opt/cmake
- pushd /opt/cmake
- wget https://github.com/Kitware/CMake/releases/download/v3.15.3/cmake-3.15.3-Linux-x86_64.tar.gz
- tar -xvzf cmake-3.15.3-Linux-x86_64.tar.gz
- popd
- ln -s /opt/cmake/cmake-3.15.3-Linux-x86_64/bin/cmake /usr/local/bin/cmake
- export CXX="g++"
- cmake .
- make
- mkdir -p ci-build/test
- mv bin/test/tests ci-build/test/tests-gcc
artifacts:
paths:
- ci-build
docs:
stage: build
image: python:3.8.0b1-alpine3.10
script:
- apk update
- apk add cmake
# python3 -m pip install --upgrade pip
- pip3 install -U sphinx
- pip3 install -U sphinx-rtd-theme
- mkdir doctemp
- mkdir ci-build
- sphinx-build -d ./doctemp ./docs/sphinx ./ci-build/docs
artifacts:
paths:
- ci-build
tests-emscripten:
stage: test
image: nnaumenko/emscripten-firefox
script:
# list browsers, for reference only
- emrun --list_browsers
# run tests with Firefox (will return exit code 1 if test failed)
- emrun --browser firefox ci-build/test/main.html --gtest_output="xml:test.xml" >ci-build/test/firefox_test_output.txt
# make bin/test/test.xml
- sed -n '/<<<<\/test.xml:BEGIN>>>>/,/<<<<\/test.xml:END>>>>/{ /<<<<\/test.xml:BEGIN>>>>/d; /<<<<\/test.xml:END>>>>/d; p }' ci-build/test/firefox_test_output.txt >ci-build/test/test.xml
# possible to additionally check for failure reports in ci-build/test/test.xml
# test -f ci-build/test/test.xml
# if [ "$(grep 'failures="[1-9]' ci-build/test/test.xml)" != "" ]; then exit 1; fi
dependencies:
- build-emscripten
artifacts:
paths:
- ci-build
reports:
junit: ci-build/test/test.xml
tests-clang:
stage: test
image: ubuntu:18.04
script:
- ci-build/test/tests-clang
dependencies:
- build-clang
tests-gcc:
stage: test
image: ubuntu:18.04
script:
- ci-build/test/tests-gcc
dependencies:
- build-gcc
pages:
stage: deploy
script:
- mkdir public
- cp -r ci-build/* public
- cp -R pages/* public
dependencies:
- build-emscripten
- tests-emscripten
- docs
artifacts:
paths:
- public
only:
- master
codecov:
stage: deploy
image: ubuntu:18.04
variables:
GIT_SUBMODULE_STRATEGY: normal
script:
- apt-get update
- apt-get -y --no-install-recommends install xz-utils build-essential curl cmake ca-certificates git
- curl -SL http://releases.llvm.org/8.0.0/clang%2bllvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | tar -xJC .
- mv clang+llvm-8.0.0-x86_64-linux-gnu-ubuntu-18.04 /clang-8.0.0
- export PATH=/clang-8.0.0/bin:$PATH
- export LD_LIBRARY_PATH=/clang-8.0.0/lib:$LD_LIBRARY_PATH
- cd test/coverage
- cmake .
- make
- ../../bin/test/testcov
- llvm-profdata merge -sparse default.profraw -o default.profdata
- llvm-profdata show -all-functions -counts -ic-targets default.profdata > profile.txt
- llvm-cov show ../../bin/test/testcov -instr-profile=default.profdata >coverage.txt
- mkdir ../../ci-profile-coverage
- cp {default.*,profile.txt,coverage.txt} ../../ci-profile-coverage
- curl -S https://codecov.io/bash -o codecov.sh
- chmod +x codecov.sh
- ./codecov.sh
artifacts:
paths:
- ci-profile-coverage
only:
- master