Skip to content

Commit

Permalink
Merge dev
Browse files Browse the repository at this point in the history
  • Loading branch information
popzxc committed Jan 19, 2021
2 parents aaa750b + 3c3dfc8 commit c02852f
Show file tree
Hide file tree
Showing 271 changed files with 4,940 additions and 3,990 deletions.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
!docker/exit-tool/configs
!docker/keybase-secrets/entrypoint.sh
!docker/ci-integration-test/entrypoint.sh
!docker/zk/entrypoint.sh
!etc/env/dev.env.example
!etc/env/docker.env
!etc/env/base
!etc/tokens
!keys/packed
!docker/nginx/nginx.conf
Expand All @@ -18,6 +21,5 @@
!infrastructure/explorer/index.html
!infrastructure/explorer/dist
!infrastructure/fee-seller
!infrastructure/tok_cli
!infrastructure/zk
!sdk/zksync-rs
7 changes: 7 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
./volumes/**/*
node_modules
**/node_modules/**
build/
dist/
volumes/
.tslintrc.js
Empty file modified .githooks/pre-commit
100755 → 100644
Empty file.
Empty file modified .githooks/pre-push
100755 → 100644
Empty file.
3 changes: 2 additions & 1 deletion .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
status = ["ci-all"]
status = ["lint", "unit-tests", "integration", "testkit"]
delete_merged_branches = true
update_base_for_deletes = true
timeout_sec = 7200
241 changes: 135 additions & 106 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,111 +8,140 @@ on:
- trying

jobs:
ci-all:
# We currently have two self-hosted runners, one of which is marked "DEV-CI" and other one is marder "MAIN".
# "MAIN" is the current CI runner, "DEV-CI" is currently used to experiment with CI optimizing.
runs-on: [self-hosted, MAIN]
lint:
runs-on: [self-hosted, CI-worker]

steps:
- uses: actions/checkout@v2

- name: link-setup-keys
run: ln -s ~/setup keys/setup

- name: setup-env
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo CI=1 >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
- name: cache-contracts
uses: actions/cache@v2
with:
path: |
contracts/build
contracts/node_modules
contracts/dev-contracts/generated
key: ${{ runner.os }}-contracts-${{ hashFiles('contracts/contracts/*.sol') }}

- name: cache-rust
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: update-deps
run: |
rustup update stable
cargo install --version=0.2.0 sqlx-cli
cargo install diesel_cli --no-default-features --features postgres
docker pull matterlabs/ci-integration-test:latest
- name: zk
run: zk

- name: lints
run: |
# lint non-rust code
zk fmt --check
yarn lint:md
yarn lint:sol
cargo fmt --all -- --check
zk f cargo clippy --tests --benches -- -D warnings
pushd sdk/zksync-crypto
cargo fmt -- --check
cargo clippy --all --tests --benches -- -D warnings
env:
SQLX_OFFLINE: "true"

- name: generic-init
run: |
# Unpack keys to build dev contracts
zk run verify-keys unpack
# EIP1271 contract is used in Rust & JS unit tests.
zk contract build
zk run deploy-eip1271
- name: integration-tests
run: zk test integration all --in-docker

- name: integration-testkit
run: zk test integration testkit
env:
SQLX_OFFLINE: "true"

- name: contracts-unit-tests
run: zk test contracts

- name: js-unit-tests
run: zk test js

- name: rust-unit-tests
run: |
# Api tests require database setup
zk db setup
zk test rust
- name: zksync-crypto-tests
run: pushd sdk/zksync-crypto && zk f cargo test --release

services:
geth:
image: matterlabs/geth:latest
ports:
- 8545:8545
- 8546:8546
env:
CONFIG: standard

postgres:
image: postgres:10.4
ports:
- 5432:5432

dev-ticker:
image: matterlabs/dev-ticker:latest
ports:
- 9876:9876
- uses: actions/checkout@v2

- name: setup-env
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
- name: start-services
run: |
docker-compose -f docker-compose-runner.yml down
docker-compose -f docker-compose-runner.yml up --build -d zk
ci_run sccache --start-server
- name: setup-env
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
- name: lints
run: |
ci_run zk
ci_run zk fmt --check
ci_run zk lint --check
unit-tests:
runs-on: [self-hosted, CI-worker]

steps:
- uses: actions/checkout@v2

- name: setup-env
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
- name: start-services
run: |
docker-compose -f docker-compose-runner.yml down
docker-compose -f docker-compose-runner.yml up --build -d geth postgres zk
ci_run sccache --start-server
- name: init
run: |
ci_run ln -s /usr/src/keys/setup keys/setup
ci_run zk
ci_run zk run verify-keys unpack
ci_run zk contract build-dev
ci_run zk run deploy-erc20 dev
ci_run zk run deploy-eip1271
ci_run zk db basic-setup
ci_run zk run yarn
- name: liquidity-token
run: docker-compose -f docker-compose-runner.yml restart dev-liquidity-token-watcher

- name: contracts-unit-tests
run: ci_run zk test contracts

- name: js-unit-tests
run: ci_run zk test js

- name: rust-unit-tests
run: ci_run zk test rust

integration:
runs-on: [self-hosted, CI-worker]

steps:
- uses: actions/checkout@v2

- name: setup-env
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
- name: start-services
run: |
docker-compose -f docker-compose-runner.yml down
docker-compose -f docker-compose-runner.yml up --build -d geth postgres zk
ci_run sccache --start-server
- name: init
run: |
ci_run ln -s /usr/src/keys/setup keys/setup
ci_run zk
ci_run zk dummy-prover enable --no-redeploy
ci_run zk init
- name: liquidity-token
run: docker-compose -f docker-compose-runner.yml restart dev-liquidity-token-watcher

- name: run-services
run: ci_run sh infrastructure/ci-scripts/run_services.sh

- name: integration-server
run: ci_run zk test i server

- name: integration-api
run: ci_run zk test i api

- name: integration-zcli
run: ci_run zk test i zcli

- name: integration-rust-sdk
run: ci_run zk test i rust-sdk


testkit:
runs-on: [self-hosted, CI-worker]

steps:
- uses: actions/checkout@v2

- name: prepare
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
- name: start-services
run: |
docker-compose -f docker-compose-runner.yml down
docker-compose -f docker-compose-runner.yml up --build -d zk
ci_run sccache --start-server
- name: init
run: |
ci_run ln -s /usr/src/keys/setup keys/setup
ci_run zk
ci_run zk run verify-keys unpack
ci_run zk contract build-dev
- name: integration-testkit
run: ci_run zk test integration testkit --offline
2 changes: 1 addition & 1 deletion .github/workflows/promote-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
zk run yarn
cp etc/tokens/{test,localhost}.json
zk run verify-keys unpack
zk db setup
zk db basic-setup
- name: update-images
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Cargo.lock

/etc/env/*
!/etc/env/dev.env.example
!/etc/env/docker.env
!/etc/env/ci.env
!/etc/env/base
/etc/tokens/localhost.json
!/keys
/keys/*
Expand Down
3 changes: 0 additions & 3 deletions .solhint.json

This file was deleted.

Loading

0 comments on commit c02852f

Please sign in to comment.