-
Notifications
You must be signed in to change notification settings - Fork 45
162 lines (145 loc) · 4.56 KB
/
nightly.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
name: libBLS Nightly Tests
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
jobs:
main_job:
runs-on: ubuntu-20.04
env:
NIGHTLY_BUILD_FLAGS: "valgrind --leak-check=yes"
steps:
- name: Extract repo name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
shell: bash
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Checkout
uses: actions/checkout@v2
# - name: Set up Python 3.6
# uses: actions/setup-python@v1
# with:
# python-version: 3.6
- name: Update apt
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
- name: Install packages
run: |
sudo apt-get install -y software-properties-common
sudo apt-get install -y gcc-9 g++-9
- name: use g++-9 by default
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 9
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 9
- name: Install more packages
run: |
sudo apt-get install -y gawk sed shtool \
libffi-dev yasm texinfo flex bison libgnutls28-dev libc6-dbg gcc-multilib
sudo snap install valgrind --classic
python -m pip install --upgrade pip
pip install coincurve
- name: Build dependencies
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
cd deps
./build.sh
- name: Configure all
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
mkdir -p build && cd build
cmake ..
- name: Build all
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
cd build
make -j$(nproc)
- name: Run tests
run: |
cp scripts/parameters.json build/
cd build
$NIGHTLY_BUILD_FLAGS ./bls_unit_test
$NIGHTLY_BUILD_FLAGS ./dkg_unit_test
$NIGHTLY_BUILD_FLAGS ./utils_unit_test
$NIGHTLY_BUILD_FLAGS ./bls_test
$NIGHTLY_BUILD_FLAGS ./threshold_encryption/te_unit_test
$NIGHTLY_BUILD_FLAGS ./threshold_encryption/te_test
$NIGHTLY_BUILD_FLAGS ./dkg_attack
# - name: Run python test
# run: |
# cd python
# ./setup.sh
# ./test.sh
# cd ..
- name: Run tools tests
run: |
./scripts/run_tools_test.sh
linux_build_with_emscripten:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [14.x]
steps:
- name: Extract repo name
run: echo ::set-env name=REPOSITORY_NAME::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}')
shell: bash
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
- name: Checkout
uses: actions/checkout@v2
- name: Update apt
run: sudo add-apt-repository ppa:ubuntu-toolchain-r/test;
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -y gcc-9 g++-9 gawk sed shtool \
libffi-dev yasm texinfo flex bison \
python3.6 lcov gcc-multilib
sudo apt-get update -qq
sudo apt-get install -y python3-pip
pip3 install --upgrade pip
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install pyopenssl ndg-httpsclient pyasn1
sudo python3 -m pip install requests[security]
- name: Install NODE JS
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Build dependencies
run: |
export CC=gcc-9
export CXX=g++-9
export TARGET=all
cd deps
./build.sh WITH_EMSCRIPTEN=1
cd ..
- name: Build all
run: |
cd deps/emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
cd ../..
mkdir -p build_em
cd build_em
export LIBRARIES_ROOT=../deps/deps_inst/x86_or_x64/lib
emcmake cmake -DEMSCRIPTEN=ON .. -DGMP_LIBRARY="$LIBRARIES_ROOT"/libgmp.a -DCRYPTOPP_LIBRARY="$LIBRARIES_ROOT"/libcrypto.a -DGMPXX_LIBRARY="$LIBRARIES_ROOT"/libgmpxx.a
emmake make -j$(nproc)
cd ..
- name: Run tests
run: |
cp tools/generate_bls_keys build_em/
cp tools/decrypt_message build_em/
cd build_em/
cp threshold_encryption/encrypt_message.* .
./generate_bls_keys
MESSAGE=`cat message.txt`
PUBLIC_BLS_KEY=`cat bls_public_key.txt`
node encrypt_message.js $MESSAGE $PUBLIC_BLS_KEY > encrypted_data.txt
./decrypt_message