forked from ElementsProject/libwally-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
111 lines (105 loc) · 4.93 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
variables:
GIT_SUBMODULE_STRATEGY: recursive
build_wally_release_files:
image: greenaddress/wallycore@sha256:f159b338f3d25e13958d79fbd709238e3864de5468b9d743625466a0a681e52b
artifacts:
expire_in: 7 days
name: wallycore-bindings
when: on_success
paths:
- dist/*
tags:
- ga
script:
- python3 -m build
- virtualenv -p python3 .smoketest
- source .smoketest/bin/activate
- pip install --find-links=./dist wallycore
- python -c "import wallycore as w; assert w.hex_from_bytes(w.hex_to_bytes('ff')) == 'ff'"
- deactivate
- rm -rf .smoketest dist/*.whl
- mv dist wally_dist
- ./tools/build_android_libraries.sh
- mv release wallycore-android-jni
- tar czf wally_dist/wallycore-android-jni.tar.gz --remove-files wallycore-android-jni
- source /opt/emsdk/emsdk_env.sh
- tools/build_wasm.sh
- cd dist
- tar czf wallycore-wasm.tar.gz --remove-files wallycore.html wallycore.js wallycore.wasm
- cd ..
- sphinx-build -b html -a -c docs/source docs/source docs/build/html
- cd docs/build
- tar czf ../../wally_dist/apidocs.tar.gz html/
- cd ../..
- mv wally_dist/* dist/
- rmdir wally_dist
build_mingw_static:
image: greenaddress/wallycore@sha256:f159b338f3d25e13958d79fbd709238e3864de5468b9d743625466a0a681e52b
tags:
- ga
script:
- ./tools/cleanup.sh && ./tools/autogen.sh
- CC=x86_64-w64-mingw32-gcc ./configure --host=x86_64-w64-mingw32 --disable-swig-python --disable-swig-java --disable-shared --enable-static
- make -j $(($(grep ^processor /proc/cpuinfo | wc -l) / 2))
run_tests:
image: greenaddress/wallycore@sha256:f159b338f3d25e13958d79fbd709238e3864de5468b9d743625466a0a681e52b
tags:
- ga
artifacts:
reports:
codequality: valgrind.json
script:
- ./tools/cleanup.sh && ./tools/autogen.sh
- ./configure --enable-export-all --enable-swig-python --enable-swig-java --enable-shared --disable-static
- make -j $(($(grep ^processor /proc/cpuinfo | wc -l) / 2))
- make check -j $(($(grep ^processor /proc/cpuinfo | wc -l) / 2))
- for t in $(ls src/.libs/test_* | egrep -v '_clear|xml|json' | tr '\n' ' '); do LD_LIBRARY_PATH=./src/.libs/ valgrind --tool=memcheck --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --xml=yes --xml-file=$t.xml $t; done
- for t in $(ls src/.libs/test_* | egrep -v '_clear|xml|json' | tr '\n' ' '); do valgrind-codequality --input-file $t.xml --output-file $t.json; done
- jq '[.[]|.[]]' -s ./src/.libs/test_*.json > valgrind.json
run_asan_ubsan_gcc:
image: greenaddress/wallycore@sha256:f159b338f3d25e13958d79fbd709238e3864de5468b9d743625466a0a681e52b
tags:
- ga
script:
- ./tools/cleanup.sh && ./tools/autogen.sh
- CC=gcc CFLAGS="-O1 -fsanitize=address -fsanitize=undefined -fsanitize=alignment -fsanitize-address-use-after-scope -fno-sanitize-recover=all" ./configure --enable-export-all --enable-swig-python --enable-swig-java --enable-shared --disable-static --disable-clear-tests --disable-asm
- sed -i 's/^PYTHON = /PYTHON = LD_PRELOAD=\/usr\/lib\/gcc\/x86_64-linux-gnu\/10\/libasan.so /g' src/Makefile
- sed -i 's/^JAVA = /JAVA = LD_PRELOAD=\/usr\/lib\/gcc\/x86_64-linux-gnu\/10\/libasan.so /g' src/Makefile
- make -j $(($(grep ^processor /proc/cpuinfo | wc -l) / 2))
- ASAN_OPTIONS=abort_on_error=1:fast_unwind_on_malloc=0:detect_leaks=0 UBSAN_OPTIONS=print_stacktrace=1 make check V=1
run_scan_build_clang:
image: greenaddress/wallycore@sha256:f159b338f3d25e13958d79fbd709238e3864de5468b9d743625466a0a681e52b
tags:
- ga
script:
- ./tools/cleanup.sh && ./tools/autogen.sh
- CC=clang CFLAGS="-O0" scan-build-11 ./configure --enable-export-all --enable-swig-python --enable-swig-java --disable-clear-tests --disable-asm
- scan-build-11 --keep-cc --exclude src/secp256k1/ make -j $(($(grep ^processor /proc/cpuinfo | wc -l) / 2))
cmake-test:
image: greenaddress/wallycore@sha256:f159b338f3d25e13958d79fbd709238e3864de5468b9d743625466a0a681e52b
tags:
- ga
script:
- mv _cmake cmake
- mv _CMakeLists.txt CMakeLists.txt
- mv src/_CMakeLists.txt src/CMakeLists.txt
- mv src/ctest/_CMakeLists.txt src/ctest/CMakeLists.txt
- cmake -B build-cmake -S .
-DBUILD_SHARED_LIBS:BOOL=FALSE
-DCMAKE_BUILD_TYPE:STRING=Debug
-DWALLYCORE_ENABLE_TESTS:BOOL=TRUE
-DWALLYCORE_ENABLE_COVERAGE:BOOL=TRUE
- cmake --build build-cmake
#- ctest --test-dir build-cmake --output-junit report.xml --output-on-failure -E "test_(clear|elements_tx)"
- cd build-cmake
- ctest --output-on-failure -E "test_(clear|elements_tx)"
- cd -
- pip install gcovr
- gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
reports:
# junit: build-cmake/report.xml # junit report generation not available in cmake 3.18
coverage_report:
coverage_format: cobertura
path: coverage.xml