Skip to content

Commit

Permalink
[CI] Integrate ewasm-testbench.
Browse files Browse the repository at this point in the history
  • Loading branch information
0yi0 committed Sep 4, 2019
1 parent d863739 commit b122675
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 11 deletions.
56 changes: 45 additions & 11 deletions .gitlab-ci.yml
@@ -1,34 +1,56 @@
variables:
GIT_SUBMODULE_STRATEGY: recursive
BASE_BINDIR: build
TEST_SRCDIR: test/release
TEST_ENVDIR: utils/ewasm-testbench

stages:
- build
- compile
- test

.build_job_template: &build_job
stage: build
image: yi2nd/soll:${OS}-${COMPILER}
before_script:
- rm -rf build
- mkdir build
- cd build
- rm -rf ${BASE_BINDIR}
- mkdir ${BASE_BINDIR}
- cd ${BASE_BINDIR}
script:
- cmake .. -DCMAKE_BUILD_TYPE=Debug -DSOLL_INCLUDE_TESTS=true
- make -j2
cache:
key: ${OS}-${COMPILER}
paths:
- build
- ${BASE_BINDIR}
policy: push

.compile_job_template: &compile_job
stage: compile
image: yi2nd/soll:${OS}-test
script:
- bash -c "${BASE_BINDIR}/tools/soll/soll ${TEST_SRCDIR}/0-0-1.sol > ${BASE_BINDIR}/0-0-1.ll"
- bash -c "${BASE_BINDIR}/tools/soll/soll ${TEST_SRCDIR}/0-0-2.sol > ${BASE_BINDIR}/0-0-2.ll"
- bash -c "./utils/compile -v ${BASE_BINDIR}/*.ll || test -f ${BASE_BINDIR}/0-0-1.wasm -a -f ${BASE_BINDIR}/0-0-2.wasm"
cache:
key: ${OS}-${COMPILER}
paths:
- ${BASE_BINDIR}
policy: pull-push

.test_job_template: &test_job
stage: test
image: yi2nd/soll:${OS}-test
before_script:
- cd build
- cp ../test/release/0-0-1.sol test.sol
- cp ${BASE_BINDIR}/*.wasm ${TEST_ENVDIR}
script:
- ctest
- bash -c "./tools/soll/soll test.sol > test.ll"
- bash -c "../utils/compile -v test.ll || true"
- bash -c "soll-ewasm-env.js test.wasm div 16 7"
- bash -c "cd ${BASE_BINDIR} && ctest"
- bash -c "cd ${TEST_ENVDIR} && ./safeMath.js 0-0-1.wasm div 16 7"
- bash -c "cd ${TEST_ENVDIR} && ./erc20.js 0-0-2.wasm {} balanceOf 1"
cache:
key: ${OS}-${COMPILER}
paths:
- build
- ${BASE_BINDIR}
policy: pull

build:ubuntu-gcc:
Expand All @@ -43,6 +65,18 @@ build:ubuntu-clang:
OS: "ubuntu"
COMPILER: "clang"

compile:ubuntu-gcc:
<<: *compile_job
variables:
OS: "ubuntu"
COMPILER: "gcc"

compile:ubuntu-clang:
<<: *compile_job
variables:
OS: "ubuntu"
COMPILER: "clang"

test:ubuntu-gcc:
<<: *test_job
variables:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
@@ -0,0 +1,3 @@
[submodule "utils/ewasm-testbench"]
path = utils/ewasm-testbench
url = ../ewasm-testbench.git
1 change: 1 addition & 0 deletions utils/ewasm-testbench
Submodule ewasm-testbench added at c06074

0 comments on commit b122675

Please sign in to comment.