forked from skalenetwork/libBLS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
143 lines (143 loc) · 6.39 KB
/
.travis.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
language: cpp
sudo: required
matrix:
include:
- os: linux
env:
- PYTHON=3.6
- BUILDING_FOR_OS=linux
- CMAKE_BUILD_FLAGS="-DCOVERAGE=ON"
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
- CPU_COUNT=$(nproc)
- NIGHTLY_BUILD_FLAGS="valgrind --leak-check=yes"
addons:
snaps:
- valgrind --classic
apt:
packages:
- g++-7
- clang-format-6.0
- gawk
- sed
- shtool
- libffi-dev
- libprocps4-dev
- yasm
- texinfo
- flex
- bison
- libc6-dbg:i386
- libc6-dbg
- python3.6
- python3.6-dev
sources: &sources
- deadsnakes
- ubuntu-toolchain-r-test
before_script:
- echo "========================================= before_script (coverage)"
- sudo apt-get update -qq
- sudo python -m pip install --upgrade pip
- sudo python -m pip install pyopenssl ndg-httpsclient pyasn1
- sudo python -m pip install requests[security]
- sudo python -m pip install codecov --ignore-installed
- sudo apt-get install python3.6
- sudo apt-get install python3-pip
- sudo apt-get install python3-setuptools
- python3.6 -m pip install coincurve
- sh -c "while :; do clear; date; sleep 300; done" &
- ./deps/build.sh PARALLEL_COUNT=$CPU_COUNT &> ./log_of_deps_build.txt || (cat ./log_of_deps_build.txt && travis_terminate 1)
- echo "========================================= before_script (codecov installed)"
after_success:
- cd python
- echo "========================================= after_success (dkg-python test)"
- ./setup.sh || travis terminate 1
- ./test.sh || travis terminate 1
- cd ..
- cd build
- echo "========================================= after_success (coverage)"
- if [ $TRAVIS_EVENT_TYPE = "cron" ]; then $NIGHTLY_BUILD_FLAGS ./bls_unit_test || travis_terminate 1; else ./bls_unit_test || travis_terminate 1; fi
- if [ $TRAVIS_EVENT_TYPE = "cron" ]; then $NIGHTLY_BUILD_FLAGS ./dkg_unit_test || travis_terminate 1; else ./dkg_unit_test || travis_terminate 1; fi
- if [ $TRAVIS_EVENT_TYPE = "cron" ]; then $NIGHTLY_BUILD_FLAGS ./bls_test || travis_terminate 1; else ./bls_test || travis_terminate 1; fi
- if [ $TRAVIS_EVENT_TYPE = "cron" ]; then $NIGHTLY_BUILD_FLAGS ./threshold_encryption/te_unit_test || travis_terminate 1; else ./threshold_encryption/te_unit_test || travis_terminate 1; fi
- if [ $TRAVIS_EVENT_TYPE = "cron" ]; then $NIGHTLY_BUILD_FLAGS ./threshold_encryption/te_test || travis_terminate 1; else ./threshold_encryption/te_test || travis_terminate 1; fi
- if [ $TRAVIS_EVENT_TYPE = "cron" ]; then $NIGHTLY_BUILD_FLAGS ./threshold_encryption/dkg_te_unit_test || travis_terminate 1; else ./threshold_encryption/dkg_te_unit_test || travis_terminate 1; fi
- cd ..
- ./get_code_cov
- echo "========================================= after_success (coverage gathered to gcov files)"
- codecov
- bash <(curl -s https://codecov.io/bash)
- echo "========================================= after_success (coverage end)"
before_deploy:
- VERSION=$(BRANCH=$TRAVIS_BRANCH bash ./scripts/calculate_version.sh)
- echo "Version $VERSION"
- export VERSION=$VERSION
# Set up git user name and tag this commit
- (
test ! $TRAVIS_TAG && ! [ "$TRAVIS_EVENT_TYPE" = "cron" ] &&
git config --local user.name "skale-travis" &&
git config --local user.email "$GITHUB_EMAIL" &&
export TRAVIS_TAG=$VERSION &&
git tag "$TRAVIS_TAG" &&
git push https://[email protected]/$TRAVIS_REPO_SLUG.git $TRAVIS_TAG
) || true
deploy:
- provider: releases
api_key: "$GITHUB_OAUTH_TOKEN"
file: {"build/bls_glue", "build/verify_bls", "build/hash_g1"}
skip_cleanup: true
name: $VERSION
on:
repo: $TRAVIS_REPO_SLUG
branch: master
- provider: releases
api_key: "$GITHUB_OAUTH_TOKEN"
file:
- "build/bls_glue"
- "build/verify_bls"
- "build/hash_g1"
skip_cleanup: true
prerelease: true
name: $VERSION
on:
repo: $TRAVIS_REPO_SLUG
branch:
- develop
- beta
- stable
- os: osx
osx_image: xcode10.1
env:
- BUILDING_FOR_OS=osx
- CMAKE_BUILD_FLAGS="-DWITH_PROCPS=OFF"
- OPENSSL_ROOT_DIR=/usr/local/opt/openssl
- LIBTOOL=glibtool
- CPU_COUNT=$(sysctl -n hw.physicalcpu )
addons:
apt:
packages:
- yasm
- texinfo
- shtool
- libtool
before_script:
- ln -s $(which glibtool) /usr/local/bin/libtool || true
- ln -s $(which glibtoolize) /usr/local/bin/libtoolize || true
- ./deps/build.sh
before_install:
- eval "${MATRIX_EVAL}"
script:
- echo "========================================= script (1)"
- echo "CMAKE_BUILD_FLAGS=$CMAKE_BUILD_FLAGS"
- mkdir -p build
- cd build
- cmake $CMAKE_BUILD_FLAGS ..
- if [ "$TRAVIS_OS_NAME" != "osx" ]; then make bls-format-check || travis_terminate 1; fi
- cmake --build . -- -j$CPU_COUNT
- cd ..
- echo "========================================= script (2)"
notifications:
email:
recipients:
on_success: change
on_failure: always