-
Notifications
You must be signed in to change notification settings - Fork 266
206 lines (204 loc) · 5.67 KB
/
sim-example.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
name: run example (sim only) # TODO: add custom runner
on:
push:
branches: [ '**' ]
pull_request:
branches: [ '**' ]
schedule: [cron: "40 1 * * *"]
jobs:
single-test:
strategy:
matrix:
runs-on:
- ubuntu-18.04
image:
- "baiduxlab/sgx-rust:1804-1.1.4"
- "baiduxlab/sgx-rust:2004-1.1.4"
- "baiduxlab/sgx-rust:centos8-1.1.4"
single-sample:
- "backtrace"
- "crypto"
- "file"
- "hello-regex"
- "hello-rust"
- "hello-rust-vscode-debug"
- "helloworld"
- "http_req"
- "kvdb-memdb"
- "localattestation"
- "logger"
- "machine-learning"
- "prost-protobuf"
- "protobuf"
- "sealeddata"
- "secretsharing"
- "serialize"
- "sgx-cov"
- "switchless"
- "tcmalloc"
- "thread"
- "unit-test"
- "wasmi"
- "zlib-lazy-static-sample"
runs-on: ${{ matrix.runs-on }}
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v1
with:
submodules: 'true'
- name: Set up Github Actions' $HOME
run: |
cp /root/.bashrc $HOME/.bashrc &&
ln -sf /root/.rustup ~/.rustup &&
ln -sf /root/.cargo ~/.cargo
- name: Rust toolchains
run: |
. ~/.cargo/env &&
rustc --version &&
rustup --version &&
cargo --version
shell: bash
- name: Run tests
run: |
. ~/.cargo/env &&
. /opt/sgxsdk/environment &&
export SGX_SDK_RUST=`git worktree list | head | cut -d ' ' -f 1` &&
cd samplecode/${{ matrix.single-sample }} &&
if [ "${{ matrix.single-sample }}" == "protobuf" ]; then cargo install protobuf-codegen --vers=2.8.1; fi
SGX_MODE=SW make &&
cd bin &&
./app
shell: bash
tls-test:
strategy:
matrix:
runs-on:
- ubuntu-18.04
image:
- "baiduxlab/sgx-rust:1804-1.1.4"
- "baiduxlab/sgx-rust:2004-1.1.4"
- "baiduxlab/sgx-rust:centos8-1.1.4"
runs-on: ${{ matrix.runs-on }}
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v1
with:
submodules: 'true'
- name: Set up Github Actions' $HOME
run: |
cp /root/.bashrc $HOME/.bashrc &&
ln -sf /root/.rustup ~/.rustup &&
ln -sf /root/.cargo ~/.cargo &&
yum install -y which expect || true
- name: Rust toolchains
run: |
. ~/.cargo/env &&
rustc --version &&
rustup --version &&
cargo --version
shell: bash
- name: Run tls sample
run: |
. ~/.cargo/env &&
. /opt/sgxsdk/environment &&
export SGX_MODE=SW
SAVEIFS=$IFS
CIDIR=$(pwd)/.github/workflows
IFS=$(echo -en "\n\b")
compiles=('make' 'XARGO_SGX=1 make')
cd samplecode/tls
for client in ${compiles[@]}
do
for server in ${compiles[@]}
do
cd tlsclient && eval ${client} && \
cd ../tlsserver && eval ${server} && \
cd bin
echo "Starting server"
$CIDIR/tlsserver.expect &
pid=$!
sleep 1
cd ../../tlsclient/bin
echo "Starting client"
$CIDIR/tlsclient.expect
cliret=$?
wait $pid
svrret=$?
if [ ! $cliret -eq 0 ] | [ ! $svrret -eq 0 ]; then
echo "TLS test fail"
exit 1
fi
echo "Testing passed"
cd ../..
done
done
IFS=$SAVEIFS
shell: bash
mio-test:
strategy:
matrix:
runs-on:
- ubuntu-18.04
image:
- "baiduxlab/sgx-rust:1804-1.1.4"
- "baiduxlab/sgx-rust:2004-1.1.4"
- "baiduxlab/sgx-rust:centos8-1.1.4"
runs-on: ${{ matrix.runs-on }}
container:
image: ${{ matrix.image }}
steps:
- uses: actions/checkout@v1
with:
submodules: 'true'
- name: Set up Github Actions' $HOME
run: |
cp /root/.bashrc $HOME/.bashrc &&
ln -sf /root/.rustup ~/.rustup &&
ln -sf /root/.cargo ~/.cargo &&
yum install -y which expect || true
- name: Rust toolchains
run: |
. ~/.cargo/env &&
rustc --version &&
rustup --version &&
cargo --version
shell: bash
- name: Run tls sample
run: |
. ~/.cargo/env &&
. /opt/sgxsdk/environment &&
export SGX_MODE=SW
SAVEIFS=$IFS
CIDIR=$(pwd)/.github/workflows
IFS=$(echo -en "\n\b")
compiles=('make' 'XARGO_SGX=1 make')
cd samplecode/mio
for client in ${compiles[@]}
do
for server in ${compiles[@]}
do
cd client && eval ${client} && \
cd ../server && eval ${server} && \
cd bin
echo "Starting server"
$CIDIR/mioserver.expect &
pid=$!
sleep 1
cd ../../client/bin
echo "Starting client"
$CIDIR/mioclient.expect
cliret=$?
wait $pid
svrret=$?
if [ ! $cliret -eq 0 ] | [ ! $svrret -eq 0 ]; then
echo "mio test fail"
exit 1
fi
echo "Testing passed"
cd ../..
done
done
IFS=$SAVEIFS
shell: bash