forked from matter-labs/zksync
-
Notifications
You must be signed in to change notification settings - Fork 10
129 lines (104 loc) · 3.92 KB
/
ci-iov.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
name: Unit/integration tests
on:
pull_request:
types: [ready_for_review]
jobs:
unit-integration-tests:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: install mkcert
run: |
wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.3/mkcert-v1.4.3-linux-amd64
chmod +x ./mkcert*
cp ./mkcert* bin/mkcert
- name: setup-env
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
# dev.env file is required before running zk init
- name: create-empty-dev-file
run: |
touch $ZKSYNC_HOME/etc/env/dev.env
- name: start-services
run: |
docker-compose -f docker-compose.ci.yml down
docker-compose -f docker-compose.ci.yml pull
docker-compose -f docker-compose.ci.yml -f docker-compose.ci.unit-tests.yml up --build -d rskj postgres zk
ci_run sccache --start-server &
- name: generate SSL certificates
run: |
ci_run mkcert -CAROOT
ci_run mkcert --install
ci_run mkcert 127.0.0.1 localhost
ci_run mv 127.0.0.1+1-key.pem key.pem
ci_run mv 127.0.0.1+1.pem cert.pem
- name: init
run: |
ci_run ln -s /usr/src/keys/setup keys/setup
sed -i '/plonkSetup/d' infrastructure/zk/src/init.ts
ci_run zk
ci_run zk init
- name: start dev-ticker
run: docker-compose -f docker-compose.ci.yml up -d dev-ticker
- name: Toolchain info
run: |
node --version
ci_run rustc --version
ci_run cargo clippy --version
- name: contracts-unit-tests
run: ci_run zk test contracts
- name: witness-generator-unit-tests
run: ci_run zk test witness-generator
- name: server-rust-unit-tests
run: ci_run zk test server-rust
- name: db-unit-tests
run: ci_run zk test db
- name: rust-api-unit-tests
run: ci_run zk test rust-api
- name: start-services (rskj, postgres, zk)
run: |
docker-compose -f docker-compose.ci.yml down
docker-compose -f docker-compose.ci.yml pull
docker-compose -f docker-compose.ci.yml up --build -d rskj postgres zk
ci_run sccache --start-server &
- name: run zk init
run: |
ci_run zk
ci_run zk init
- name: start dev-ticker
run: docker-compose -f docker-compose.ci.yml up -d dev-ticker
- name: run-services
run: |
ci_run zk server core &>server.log &
ci_run zk server api &>api.log &
ci_run sleep 10
ci_run zk dummy-prover run &>dummy_prover.log &
ci_run sleep 100
- name: server-integration-tests
run: ci_run zk test i server
- name: api-integration-tests
run: |
ci_run zk test i api
ci_run zk test i api-docs
- name: rust-sdk-integration-tests
run: ci_run zk test i rust-sdk
- name: withdrawal-helpers-integration-tests
run: ci_run zk test i withdrawal-helpers
- name: Show logs
if: always()
run: |
ci_run cat server.log
ci_run cat api.log
ci_run cat dummy_prover.log
ci_run mkdir -p ./target/release/coverage/
ci_run "grcov . --binary-path ./target/release/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore '/*' -o ./target/release/coverage/lcov.info"
docker compose -f docker-compose.ci.yml cp zk:/usr/src/zksync/target/release/coverage/lcov.info lcov.info
du lcov.info
- uses: codecov/codecov-action@v3
with:
files: ./lcov.info
flags: unit-tests
name: codecov-umbrella # optional
verbose: true # optional (default = false)