This repository has been archived by the owner on Jan 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
/
circle.yml
168 lines (151 loc) · 6.09 KB
/
circle.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
163
164
165
166
167
168
defaults:
npm-install: &npm-install
run:
name: "Install npm deps"
command: |
npm install --no-package-lock
lint: &lint
run:
name: "Lint source code"
command: |
npm run lint
validate-build: &validate-build
run:
name: "Validate build artifacts were correctly included"
command: |
npm run build:validate
install-cpp-ethereum: &install-cpp-ethereum
run:
name: "Install cpp-ethereum"
command: |
URL=https://github.com/ethereum/cpp-ethereum/releases/download/v1.4.0rc4/aleth-1.4.0rc4-linux-x86_64.tar.gz
curl -L $URL | sudo tar xz -C /usr/local
build-hera: &build-hera
run:
name: "Build hera"
working_directory: ~
command: |
git clone https://github.com/ewasm/hera
cd hera
git reset 30d0354918e7265833ab78de33caafb4adbb27ea --hard
git submodule update --init --recursive
cmake -DBUILD_SHARED_LIBS=ON .
make -j8
mv ~/evm2wasm/hera/src/libhera.so ~/libhera.so
build-hera-cpp: &build-hera-cpp
run:
name: "Build hera (with builtin evm2wasm)"
working_directory: ~
command: |
git clone https://github.com/ewasm/hera
cd hera
git reset 30d0354918e7265833ab78de33caafb4adbb27ea --hard
git submodule update --init --recursive
rm -rf evm2wasm
ln -s /home/builder/evm2wasm evm2wasm
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_TOOLCHAIN_FILE=evm2wasm/cmake/toolchains/cxx11-pic.cmake .
make -j8
mv ~/evm2wasm/hera/src/libhera.so ~/libhera.so
vm-tests: &vm-tests
run:
name: "Run ethereum VM tests"
command: |
npm run vmTests
print-cpp-hera-version: &print-cpp-hera-version
run:
name: "Using cpp-ethereum and Hera versions:"
working_directory: ~/
command: |
cd cpp-ethereum
echo "cpp-ethereum branch: $(git rev-parse --abbrev-ref HEAD) commit: $(git rev-parse HEAD)"
cd hera
echo "hera branch: $(git rev-parse --abbrev-ref HEAD) commit: $(git rev-parse HEAD)"
clone-tests: &clone-tests
run:
name: "Run Ethereum state tests"
command: |
git clone https://github.com/ethereum/tests ~/tests
state-tests: &state-tests
run:
name: "Run Ethereum state tests"
working_directory: ~/build
command: |
echo 'export PATH=~/evm2wasm/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
echo "running testeth command..."
testeth -t GeneralStateTests/stExample -- --testpath ~/tests --singlenet "Byzantium" --singletest "add11" --vm ~/libhera.so --evmc evm2wasm.js=true
testeth -t GeneralStateTests/stStackTests -- --testpath ~/tests --singlenet "Byzantium" --vm ~/libhera.so --evmc evm2wasm.js=true
testeth -t GeneralStateTests/stBadOpcode -- --testpath ~/tests --singlenet "Byzantium" --vm ~/libhera.so --evmc evm2wasm.js=true
testeth -t GeneralStateTests/stCallCodes -- --testpath ~/tests --singlenet "Byzantium" --singletest "callcall_00" --vm ~/libhera.so --evmc evm2wasm.js=true
testeth -t GeneralStateTests/stCallCodes -- --testpath ~/tests --singlenet "Byzantium" --singletest "callcallcode_01" --vm ~/libhera.so --evmc evm2wasm.js=true
testeth -t GeneralStateTests/stMemoryTest -- --testpath ~/tests --singlenet "Byzantium" --singletest "memReturn" --vm ~/libhera.so --evmc evm2wasm.js=true
echo "ran the state tests."
state-tests: &state-tests-cpp
run:
name: "Run Ethereum state tests"
working_directory: ~/build
command: |
echo 'export PATH=~/evm2wasm/bin:$PATH' >> $BASH_ENV
source $BASH_ENV
echo "running testeth command..."
testeth -t GeneralStateTests/stExample -- --testpath ~/tests --singlenet "Byzantium" --singletest "add11" --vm ~/libhera.so --evmc evm2wasm.cpp=true
#testeth -t GeneralStateTests/stStackTests -- --testpath ~/tests --singlenet "Byzantium" --vm ~/libhera.so --evmc evm2wasm.cpp=true
testeth -t GeneralStateTests/stBadOpcode -- --testpath ~/tests --singlenet "Byzantium" --vm ~/libhera.so --evmc evm2wasm.cpp=true
testeth -t GeneralStateTests/stCallCodes -- --testpath ~/tests --singlenet "Byzantium" --singletest "callcall_00" --vm ~/libhera.so --evmc evm2wasm.cpp=true
testeth -t GeneralStateTests/stCallCodes -- --testpath ~/tests --singlenet "Byzantium" --singletest "callcallcode_01" --vm ~/libhera.so --evmc evm2wasm.cpp=true
testeth -t GeneralStateTests/stMemoryTest -- --testpath ~/tests --singlenet "Byzantium" --singletest "memReturn" --vm ~/libhera.so --evmc evm2wasm.cpp=true
echo "ran the state tests."
cli-tests: &cli-tests
run:
name: "Basic CLI validation"
working_directory: ~/evm2wasm
command: |
bin/evm2wasm.js 600160020200 --trace
build/tools/evm2wasm/evm2wasm <(echo "600160020200")
js-state-test-steps: &js-state-test-steps
- checkout
- *npm-install
- *lint
- *validate-build
- *clone-tests
#- *build-cpp
#- *cli-tests # weird chars mess up the console
#- *vm-tests # vm-tests temporarily disabled until ewasm-kernel is fixed
# - *print-cpp-hera-version
- *install-cpp-ethereum
- *build-hera
# - *store-hera
- *state-tests
cpp-state-test-steps: &cpp-state-test-steps
- checkout
- *npm-install
- *lint
- *validate-build
- *clone-tests
#- *build-cpp
#- *cli-tests # weird chars mess up the console
#- *vm-tests # vm-tests temporarily disabled until ewasm-kernel is fixed
# - *print-cpp-hera-version
- *install-cpp-ethereum
- *build-hera-cpp
# - *store-hera
- *state-tests-cpp
version: 2
jobs:
# to run this using local circleci tool, rename Ewasm-Tests to `build` then do `circleci build -c circle.yml`
build-js:
working_directory: ~/evm2wasm
docker:
- image: cdetrio/nodejs-cpp-build-env
steps: *js-state-test-steps
build-cpp:
working_directory: ~/evm2wasm
docker:
- image: cdetrio/nodejs-cpp-build-env
steps: *cpp-state-test-steps
workflows:
version: 2
evm2wasm-build:
jobs:
- build-js
- build-cpp