Skip to content

Commit c851de8

Browse files
authored
Merge pull request #180 from pmconrad/2054_github_autobuild
Add GitHub autobuild
2 parents 1d8b63b + 6e5fe1f commit c851de8

File tree

4 files changed

+129
-5
lines changed

4 files changed

+129
-5
lines changed

.github/workflows/build-and-test.yml

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Github Autobuild
2+
on: [ push, pull_request ]
3+
env:
4+
CCACHE_COMPRESS: exists means true
5+
CCACHE_SLOPPINESS: include_file_ctime,include_file_mtime,time_macros
6+
jobs:
7+
test-release:
8+
name: Build and run tests in Release mode
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Install dependencies
12+
run: |
13+
sudo apt-get install -y \
14+
ccache \
15+
parallel \
16+
libboost-thread-dev \
17+
libboost-iostreams-dev \
18+
libboost-date-time-dev \
19+
libboost-system-dev \
20+
libboost-filesystem-dev \
21+
libboost-program-options-dev \
22+
libboost-chrono-dev \
23+
libboost-test-dev \
24+
libboost-context-dev \
25+
libboost-regex-dev \
26+
libboost-coroutine-dev
27+
- uses: actions/checkout@v1
28+
with:
29+
submodules: recursive
30+
- name: Configure
31+
run: |
32+
mkdir -p _build
33+
pushd _build
34+
cmake -D CMAKE_BUILD_TYPE=Release \
35+
-D CMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \
36+
-D CMAKE_C_COMPILER=gcc \
37+
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
38+
-D CMAKE_CXX_COMPILER=g++ \
39+
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
40+
..
41+
popd
42+
- name: Load Cache
43+
uses: actions/cache@v1
44+
with:
45+
path: ccache
46+
key: ccache-release-${{ github.ref }}-${{ github.sha }}
47+
restore-keys: |
48+
ccache-release-${{ github.ref }}-
49+
ccache-release-
50+
ccache-
51+
- name: Build
52+
run: |
53+
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
54+
mkdir -p "$CCACHE_DIR"
55+
make -j 2 -C _build
56+
- name: Test
57+
run: |
58+
parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_
59+
all_tests
60+
bloom_test -- README.md
61+
ecc_test README.md
62+
hmac_test
63+
task_cancel_test
64+
_EOT_
65+
test-debug:
66+
name: Build and run tests in Debug mode
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: Install dependencies
70+
run: |
71+
sudo apt-get install -y \
72+
ccache \
73+
parallel \
74+
libboost-thread-dev \
75+
libboost-iostreams-dev \
76+
libboost-date-time-dev \
77+
libboost-system-dev \
78+
libboost-filesystem-dev \
79+
libboost-program-options-dev \
80+
libboost-chrono-dev \
81+
libboost-test-dev \
82+
libboost-context-dev \
83+
libboost-regex-dev \
84+
libboost-coroutine-dev
85+
- uses: actions/checkout@v1
86+
with:
87+
submodules: recursive
88+
- name: Configure
89+
run: |
90+
mkdir -p _build
91+
pushd _build
92+
cmake -D CMAKE_BUILD_TYPE=Debug \
93+
-D CMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON \
94+
-D CMAKE_C_COMPILER=gcc \
95+
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
96+
-D CMAKE_CXX_COMPILER=g++ \
97+
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
98+
..
99+
popd
100+
- name: Load Cache
101+
uses: actions/cache@v1
102+
with:
103+
path: ccache
104+
key: ccache-debug-${{ github.ref }}-${{ github.sha }}
105+
restore-keys: |
106+
ccache-debug-${{ github.ref }}-
107+
ccache-debug-
108+
ccache-
109+
- name: Build
110+
run: |
111+
export CCACHE_DIR="$GITHUB_WORKSPACE/ccache"
112+
mkdir -p "$CCACHE_DIR"
113+
make -j 2 -C _build
114+
- name: Test
115+
run: |
116+
parallel echo Running {}\; sh -c "_build/tests/{}" <<_EOT_
117+
all_tests
118+
bloom_test -- README.md
119+
ecc_test README.md
120+
hmac_test
121+
task_cancel_test
122+
_EOT_

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ fc
22
==
33

44
[![](https://travis-ci.org/bitshares/bitshares-fc.svg?branch=master)](https://travis-ci.org/bitshares/bitshares-fc)
5+
[![](https://github.com/bitshares/bitshares-fc/workflows/Github%20Autobuild/badge.svg?branch=master)](https://github.com/bitshares/bitshares-fc/actions?query=branch%3Amaster)
56

67
**NOTE:** This fork reverts upstream commit a421e280488385cab26a42153f7ce3c8d5b6281f to avoid changing the BitShares API.
78

tests/crypto/dh_test.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ BOOST_AUTO_TEST_CASE(dh_test)
5050
alice.p.clear(); alice.p.push_back(100); alice.p.push_back(2);
5151
BOOST_CHECK( !alice.validate() );
5252
alice.p = bob.p;
53-
alice.g = 9;
53+
alice.g = 1;
5454
BOOST_CHECK( !alice.validate() );
5555
}
5656

tests/stacktrace_test.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,18 @@ class _svdt_visitor
6464
BOOST_AUTO_TEST_CASE(static_variant_depth_test)
6565
{
6666
int64_t i = 1;
67-
fc::static_variant<uint8_t,uint16_t,uint32_t,uint64_t,int8_t,int16_t,int32_t,int64_t> test(i);
67+
fc::static_variant<std::string,std::vector<uint8_t>,std::vector<uint16_t>,std::vector<uint32_t>,
68+
uint8_t,uint16_t,uint32_t,uint64_t,int8_t,int16_t,int32_t,int64_t> test(i);
6869

6970
std::string stacktrace = test.visit( _svdt_visitor() );
70-
//std::cerr << stacktrace << "\n";
71+
std::cerr << stacktrace << "\n";
7172
std::vector<std::string> lines;
7273
boost::split( lines, stacktrace, boost::is_any_of("\n") );
7374
int count = 0;
7475
for( const auto& line : lines )
7576
if( line.find("_svdt_visitor") != std::string::npos ) count++;
76-
BOOST_CHECK_LT( 2, count ); // test.visit(), static_variant::visit, function object, visitor
77-
BOOST_CHECK_GT( 8, count ); // some is implementation-dependent
77+
BOOST_CHECK_LT( 1, count ); // The actual count depends on compiler and optimization settings.
78+
BOOST_CHECK_GT( 10, count ); // It *should* be less than the number of static variant components.
7879
}
7980
#endif
8081

0 commit comments

Comments
 (0)