-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy path.gitlab-ci.yml
154 lines (141 loc) · 4.05 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
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
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
variables:
GIT_SUBMODULE_STRATEGY: recursive
BASE_BINDIR: build
TEST_SRCDIR: test/release
TEST_ENVDIR: utils/ewasm-testbench
LIT_PATH: /usr/lib/llvm-8/build/utils/lit/lit.py
EVM_BINDIR: /evm_llvm_build
EVM_LIT_PATH: ${EVM_BINDIR}/bin/llvm-lit
stages:
- build
- compile
- test
- deploy
# Templates
.before_build: &before_build
- rm -rf ${BASE_BINDIR}
- mkdir ${BASE_BINDIR}
- cd ${BASE_BINDIR}
.cache_paths: &cache_paths
paths:
- ${BASE_BINDIR}
.build_job_template: &build_job
stage: build
image: secondstate/soll:${KEY}
before_script:
- *before_build
script:
- cmake .. ${CMAKE_OPTIONS}
- make -j2
cache:
<<: *cache_paths
key: ${KEY}
policy: push
# General Build Jobs
ubuntu-gcc:
<<: *build_job
tags: ["gcc"]
variables:
CMAKE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug -DSOLL_INCLUDE_TESTS=true -DLLVM_EXTERNAL_LIT=${LIT_PATH}"
KEY: "ubuntu-gcc"
ubuntu-clang:
<<: *build_job
tags: ["clang"]
variables:
CMAKE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug -DSOLL_INCLUDE_TESTS=true -DLLVM_EXTERNAL_LIT=${LIT_PATH}"
KEY: "ubuntu-clang"
# Jobs for Ewasm Backend
compile:wasm:
stage: compile
image: secondstate/soll:ubuntu-compile
needs: ["ubuntu-clang"]
tags: ["clang"]
variables:
SOLL_PATH: "${BASE_BINDIR}/tools/soll/soll"
script:
- bash -c "for f in $TEST_ENVDIR/test/*.sol; do $SOLL_PATH \$f; done"
- bash -c "for f in $TEST_ENVDIR/test/*.wasm; do mv -- \$f \${f%.wasm}.deploy.wasm; done"
- bash -c "for f in $TEST_ENVDIR/test/*.sol; do $SOLL_PATH -runtime \$f; done"
- bash -c "for f in $TEST_ENVDIR/test/*.yul; do $SOLL_PATH -lang=Yul \$f; done"
- bash -c "$SOLL_PATH -lang=Yul test/yul/switch.yul"
- bash -c "$SOLL_PATH -lang=Yul test/yul/tuple.yul"
after_script:
- cp ${TEST_ENVDIR}/test/*.wasm ${BASE_BINDIR}
- cp test/yul/*.wasm ${BASE_BINDIR}
cache:
<<: *cache_paths
key: ubuntu-clang
policy: pull-push
test:wasm:
stage: test
image: secondstate/soll:ubuntu-test
needs: ["compile:wasm"]
tags: ["clang"]
before_script:
- cp ${BASE_BINDIR}/*.wasm ${TEST_ENVDIR}/test
script:
- bash -c "cd ${BASE_BINDIR} && ctest --output-on-failure"
- bash -c "cd ${TEST_ENVDIR} && mocha"
- bash -c "cd ${TEST_ENVDIR} && ./index.js test/switch.wasm '' '{}'"
- bash -c "cd ${TEST_ENVDIR} && ./index.js test/tuple.wasm '' '{}'"
cache:
<<: *cache_paths
key: ubuntu-clang
policy: pull
# Jobs for EVM backend
#ubuntu-clang:evm:
# <<: *build_job
# tags: ["evm"]
# variables:
# CMAKE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug -DSOLL_INCLUDE_TESTS=true -DLLVM_EXTERNAL_LIT=${LIT_PATH} -DSOLL_ENABLE_EVM=true -DLLVM_CMAKE_PATH=${EVM_BINDIR}"
# KEY: "ubuntu-evm-llvm"
#compile:evm:
# stage: compile
# image: secondstate/soll:ubuntu-evm-llvm
# needs: ["ubuntu-clang:evm"]
# tags: ["evm"]
# variables:
# SOLL_PATH: "${BASE_BINDIR}/tools/soll/soll"
# script:
# - bash -c "./utils/compile -v sol evm ${TEST_ENVDIR}/test/*.sol"
# cache:
# <<: *cache_paths
# key: ubuntu-evm-llvm
# policy: pull-push
# Jobs for Coverage Report
coverage:ubuntu:
<<: *build_job
tags: ["coverage"]
variables:
CMAKE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug -DSOLL_INCLUDE_TESTS=true -DSOLL_COVERAGE=true -DLLVM_EXTERNAL_LIT=${LIT_PATH}"
# CMAKE_OPTIONS: "-DCMAKE_BUILD_TYPE=Debug -DSOLL_INCLUDE_TESTS=true -DSOLL_COVERAGE=true -DLLVM_EXTERNAL_LIT=${LIT_PATH} -DSOLL_ENABLE_EVM=true -DLLVM_CMAKE_PATH=${EVM_BINDIR}"
KEY: "ubuntu-coverage"
coverage:test:
stage: test
image: secondstate/soll:ubuntu-coverage
needs: ["coverage:ubuntu"]
tags: ["coverage"]
before_script:
- cd ${BASE_BINDIR}
script:
- make -j2 coverage
cache:
<<: *cache_paths
key: ubuntu-coverage
policy: pull-push
pages:
stage: deploy
image: secondstate/soll:ubuntu-coverage
needs: ["coverage:test"]
tags: ["coverage"]
script:
- mv -v ${BASE_BINDIR}/coverage public
cache:
<<: *cache_paths
key: ubuntu-coverage
policy: pull
artifacts:
paths: ["public"]
only:
- master