forked from sofa-framework/ci
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_ci.sh
executable file
·62 lines (47 loc) · 1.5 KB
/
run_ci.sh
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
#!/bin/bash
fail() {
github-notify $1 $2
exit -1
}
export WORKSPACE_PATH=$PWD
export SCRIPTS_PATH=/builds/ci/scripts
export CARIBOU_MIMESIS_PATH=/builds/caribou
. $SCRIPTS_PATH/update_sofa.sh
. $SCRIPTS_PATH/utils.sh
. $SCRIPTS_PATH/github.sh
set -o errexit # Exit on error
git config --global user.name 'mimesis-bot'
git config --global user.email '<>'
if vm-is-ubuntu; then
export GITHUB_CONTEXT="Ubuntu-16.04_GCC-5.4_Clang-3.8"
## No need to do this on every vm. This script merges wip branches on project caribou into the mimesis branch
. $SCRIPTS_PATH/update_mimesis-branch.sh
update_mimesis-branch $CARIBOU_MIMESIS_PATH
elif vm-is-windows; then
export GITHUB_CONTEXT="Windows-7_MSVC-14.0"
else
export GITHUB_CONTEXT="MacOS-10.13_Clang-3.5"
fi
export GITHUB_REPOSITORY="mimesis-inria/caribou"
export GITHUB_TARGET_URL=$BUILD_URL
export GITHUB_COMMIT_HASH=$GIT_COMMIT
export GITHUB_MIMESISBOT_TOKEN=$GIT_TOKEN_JKCONF
export GITHUB_NOTIFY="true"
github-notify "pending" "Updating SOFA..."
## First update sofa if necessary
update_sofa /builds/sofa/build || fail "error" "SOFA build failure."
github-notify "pending" "Building..."
cd $WORKSPACE_PATH
echo $PWD
mkdir -p $PWD/build
cd $PWD/build
cmake .. -DCMAKE_PREFIX_PATH=/builds/sofa/build/install || fail "error" "CMake config failed."
i=0
make -j8 || fail "failure" "Build failed."
github-notify "pending" "Running tests..."
cd bin
i=0
for file in *; do
./$file || let "var++"
done
github-notify "success" "$i tests failed"